Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

make field un updatable mongoose

//Won't throw an error if there's an attempt to change the field.
const Schema = new mongoose.Schema({
    field: {
        type: String,
        immutable: true
    }
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #field #updatable #mongoose
ADD COMMENT
Topic
Name
7+7 =