Closed pbespechnyi closed 8 years ago
I've added the ability to pass extra options (like index) when defining the fields. This is available in version 0.6.0 on npm.
Example:
var opts = {
createdAt: {
name: 'customNameCreatedAt',
type: Date,
index: true
},
updatedAt: {
name: 'customNameUpdatedAt',
type: Date,
indexed: true
}
};
var CustomizedTypeOptionsTimeCopSchema = new Schema({
email: String
});
CustomizedTypeOptionsTimeCopSchema.plugin(timestamps, opts);
Thanks!
Is there any way of defining indices for createdAt and updatedAt attributes?