The modified field gets on just fine, but the created field doesn't get attached to any of the schemas I'm using the plugin for... I've tried providing a createdPath, and that didn't make a difference. The weird thing is when I print out the schema immediately after calling .plugin it shows the created field in the schema, however, none of the objects in my database have acreated field, just a modified field. Am I missing something here?
This is how I'm using it: schema.plugin(troop.timestamp); where schema is one of my mongoose schemas. That's the right way to do it right?
The modified field gets on just fine, but the created field doesn't get attached to any of the schemas I'm using the plugin for... I've tried providing a createdPath, and that didn't make a difference. The weird thing is when I print out the schema immediately after calling
.plugin
it shows the created field in the schema, however, none of the objects in my database have acreated
field, just amodified
field. Am I missing something here?This is how I'm using it:
schema.plugin(troop.timestamp);
whereschema
is one of my mongoose schemas. That's the right way to do it right?