1

In my original schema I had a field :

created: Date

I added a default to this field like so :

created: { type: Date, default: Date.now }

Problem now is that some pre-existing records don't have this field, when these records are fetched the current date time is set for this field in the projected data.

Ideally is it possible, where the record doesn't have the field, to exclude it from the projected data automatically, as it was before adding the schema default? Failing that, how would I set up an override for the insert operation to set the defaults there instead?

iss42
  • 2,720
  • 3
  • 21
  • 37
  • 2
    Not exactly a solution to your problem, but [this answer](http://stackoverflow.com/a/15147350/2359560) may be helpful as another way to get created times. – go-oleg Aug 13 '14 at 13:51

0 Answers0