drudge / mongoose-timestamp

Adds createdAt and updatedAt date attributes that get auto-assigned to the most recent create/update timestamp
Other
308 stars 64 forks source link

Fixed conflict for createdAt and __v when doing update or findOneAnd… #48

Open abhijitborade opened 6 years ago

abhijitborade commented 6 years ago

This is patch for Issue #46. MongoError: Updating the path 'createdAt' would create a conflict at 'createdAt'

stefanwalther commented 5 years ago

Any plans to merge this?

surfer77 commented 5 years ago

When can this be merged ? getting the same error.

abhijitborade commented 5 years ago

I don't think @drudge is active. So I have published this fork separately as mongoose-timestamp2.

developdeez commented 4 years ago

@abhijitborade simply replacing mongoose-timestamp with mongoose-timestamp2, still had the error for me. Maybe I missed something?

abhijitborade commented 4 years ago

@abhijitborade simply replacing mongoose-timestamp with mongoose-timestamp2, still had the error for me. Maybe I missed something?

@developdeez, can you share your query?

developdeez commented 4 years ago

@abhijitborade simply replacing mongoose-timestamp with mongoose-timestamp2, still had the error for me. Maybe I missed something?

@developdeez, can you share your query?

 await User.findByIdAndUpdate(id, {
                $set: myUser
              });
abhijitborade commented 4 years ago

@developdeez I got it fixed. Check this issue in mongoose-timestamp2.

developdeez commented 4 years ago

@abhijitborade awesome. I'll check it out asap. thanks :)

dmackinn commented 3 years ago

@drudge Any chance this could get merged into the main package? Are you still maintaining this? A good number of people are still downloading and using this package.