e-oj / Fawn

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

upsert #25

Open xfg opened 7 years ago

xfg commented 7 years ago

I read the code and seems that the next example will not be rolled back properly:

task
  .update("cars", {make: "Toyota"}, {make: "Toyota", year: 2016})
  .options({upsert: true})
  .update("cars", {make: "Ford"}, {make: "Ford", year: 2016})
  .options({upsert: true})
  .run();

Is it true?

e-oj commented 7 years ago

Yeah I think you're onto something. I'll look into it.