williamkapke / mongo-mock

Let's pretend we have a real MongoDB
MIT License
240 stars 74 forks source link

Fixes upsert response for FindAndModify as well as fixes $setOnInsert, $set support #66

Closed angelo-hub closed 6 years ago

angelo-hub commented 6 years ago

$set and $setOnInsert can now be used together in the same update/upsert, as well as a non _id based selector, previously _id was the only selector added

angelo-hub commented 6 years ago

This PR also fixes other inconsistencies with the three update functions (update, updateOne, updateMany) and their respective upsert support, not working with modifyjs, so doing $set with $setOnInsert was incompatible.