So basically I am working with mongodb using mongoose. I would like to know what are all the potential options that a field can have in a mongoose schema. For example, a user schema:
const UserSchema = new Schema(
{
username: {
required: true,
unique: true,
},
email: {
required: true,
unique: true,
},
},
{
timestamps: true,
}
);
Here the fields of the schema are username and email. The options for these fields are required and unique. What are ALL the options that a field can have in a mongoose Schema? I found schema options in the mongoose docs but it talks about autoIndex and all this other stuff that is not relevant to my question. So again my question is what are all the options that a field can have in a mongoose schema. Thank You!