mongos> db.c.insert([{_id: 0}, {_id: 1}])
BulkWriteResult({
"writeErrors" : [ ],
"writeConcernErrors" : [ ],
"nInserted" : 2,
"nUpserted" : 0,
"nMatched" : 0,
"nModified" : 0,
"nRemoved" : 0,
"upserted" : [ ]
})
mongos> db.c.find()
{ "_id" : 0 }
{ "_id" : 1 }
mongos> db.runCommand({delete: "c", deletes: [{q: {_id: 0}, limit: 1}, {q: {$bad: 1}, limit: 1}]})
{
"ok" : 1,
"n" : 1,
"writeErrors" : [
{
"index" : 1,
"code" : 2,
"errmsg" : "Could not parse delete query { $bad: 1.0 } :: caused by :: BadValue: unknown top level operator: $bad"
}
],
"$clusterTime" : {
"clusterTime" : Timestamp(1507659631, 2),
"signature" : {
"hash" : BinData(0,"rw8JpFb2h+ZOg3uZFVLiHj0yGl8="),
"keyId" : NumberLong("6475348091384889362")
}
},
"operationTime" : Timestamp(1507659631, 2)
}
mongos> db.c.find()
{ "_id" : 1 }
mongos> db.c.drop()
true
mongos> db.c.insert([{_id: 0}, {_id: 1}])
BulkWriteResult({
"writeErrors" : [ ],
"writeConcernErrors" : [ ],
"nInserted" : 2,
"nUpserted" : 0,
"nMatched" : 0,
"nModified" : 0,
"nRemoved" : 0,
"upserted" : [ ]
})
mongos> db.runCommand({delete: "c", deletes: [{q: {_id: 0}, limit: 1}, {q: {$expr: "$$unbound"}, limit: 1}]})
{
"ok" : 0,
"errmsg" : "Use of undefined variable: unbound",
"code" : 17276,
"codeName" : "Location17276"
}
mongos> db.c.find()
{ "_id" : 0 }
{ "_id" : 1 }