0

https://github.com/mongodb/node-mongodb-native

Save The save method is a shorthand for upsert if the document contains an _id, or an insert if there is no _id.

As it says on that page the save method is a shorthand. But there's no example, how do you use the save method.

I'm looking for an example to learn how to use the save method.

Harry
  • 52,711
  • 71
  • 177
  • 261

1 Answers1

0

You use the save method exactly the same way that you use the insert method.

The only difference is what its result will be if the document already exists.

Asya Kamsky
  • 41,784
  • 5
  • 109
  • 133