Skip to content

Commit

Permalink
update doc for findOneAndUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
mpangrazzi committed May 5, 2019
1 parent f592df4 commit 8022099
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/collection/findOneAndUpdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Find a document and update it in one atomic operation, requires a write lock for

1. `query` *(String|ObjectId|Object)*

2. `update` *(Object)*: Update operations to be performed on the document
2. `update` *(Object)*: Update operations to be performed on the document. As [specified in MongoDB Node.js native driver 3.x](https://github.com/mongodb/node-mongodb-native/blob/master/CHANGES_3.0.0.md#updateone--updatemany), you need to specify an atomic operator here (like a `$set`, `$unset`, or `$rename`).

3. [`options`] *(Object|String|Array)*: If the `options` is a string, it will be parsed as the fields to select.

Expand All @@ -23,5 +23,5 @@ A promise.
#### Example

```js
users.findOneAndUpdate({name: 'foo'}, {name: 'bar'}).then((updatedDoc) => {})
users.findOneAndUpdate({name: 'foo'}, { $set: { name: 'bar'} }).then((updatedDoc) => {})
```

0 comments on commit 8022099

Please sign in to comment.