- Reference >
- JavaScript Methods >
- db.getLastError()
db.getLastError()¶
-
db.
getLastError
()¶ Returns: The last error message string. Sets the level of write concern for confirming the success of write operations.
See
getLastError
for all options, Write Concern for a conceptual overview, Write Operations for information about all write operations in MongoDB, and Replica Set Write Concern for special considerations related to write concern for replica sets.