- Reference >
mongoShell Methods >- Database 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
getLastErrorand Write Concern Reference for all options, Write Concern for a conceptual overview, Write Operations for information about all write operations in MongoDB, .