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?

1
  • 2
    Not exactly a solution to your problem, but this answer may be helpful as another way to get created times. Commented Aug 13, 2014 at 13:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.