1const READ_DOCUMENTATION ;
2https://docs.mongodb.com/manual/reference/command/findAndModify/#lasterrorobject
3
4The lastErrorObject embedded document contains the following fields:
5updatedExisting boolean
6 true if an update operation modified an existing document.
7upserted document
8 Contains the ObjectId of the inserted document if an update operation with upsert: true resulted in a new document.
9Value
10 For remove operations, value contains the removed document if the query matches a document. If the query does not match a document to remove, value contains null.
11
12 For update operations, the value embedded document contains the following:
13
14 If the new parameter is not set or is false:
15
16 the pre-modification document if the query matches a document;
17 otherwise, null.
18 If new is true:
19
20 the modified document if the query returns a match;
21 the inserted document if upsert: true and no document matches the query;
22 otherwise, null.
23