Closed juanpujol closed 8 years ago
+1
@juanpujol and @roymap: I've added the ability to pass options when defining the fields to version 0.6.0 on npm:
Example:
var opts = {
createdAt: {
name: 'customNameCreatedAt',
type: String,
index: true
},
updatedAt: {
name: 'customNameUpdatedAt',
type: String,
es_indexed: true
}
};
var CustomizedTypeOptionsTimeCopSchema = new Schema({
email: String
});
CustomizedTypeOptionsTimeCopSchema.plugin(timestamps, opts);
CustomizedTypeOptionsTimeCopSchema.plugin(mongoosastic);
Awesome plugin!
Can I add an extra option to createdAt and updatedAt to index it? Thanks.