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