-
Type: Improvement
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.0.2
-
Component/s: None
-
None
-
QE 2022-11-28, QE 2022-12-12
-
(copied to CRM)
Prior to version 5.1, getLastError, db.getLastError(), or db.getLastErrorObj() could be used to get detailed information about the success or failure of write operations:
mongo << host/port/user etc >> --quiet
--eval "db.ValidProducts.drop();printjson(db.runCommand( { getLastError: 1 } ));"
{
"connectionId" : 2869,
"n" : 0,
"syncMillis" : 0,
"writtenTo" : null,
"err" : null,
"ok" : 1
}}
In MongoDB version 6.0, getLastError was removed and write commands often only return a boolean, instead of the detailed JSON output:
mongosh << host/port/user etc >> --quiet
--eval "var drc = db.ValidProducts.drop(); printjson(drc)"
false
This request is to restore the ability to get more detailed return documents from write operations.