e-oj / Fawn

Transactions for MongoDB (See the README)
https://www.npmjs.com/package/fawn
MIT License
485 stars 54 forks source link

Rolling back undefined fields #78

Open yamila-fraiman opened 5 years ago

yamila-fraiman commented 5 years ago

Not sure what's happening but when I use fawn (viasave) to update a document overriding exiting values to undefined, it's restored to the original value. Transaction results are ok and can't see the deleted value but don't know where is restored.

Eg:

Before: {name: "MyName", description: "Hello"} After: {name: "MyName"}

transaction.run({useMongoose: true}).then((results) => {
    //results[0] is {name: "MyName"} but if I query db is {name: "MyName", description: "Hello"}
});