Closed gianpaj closed 2 years ago
Looks like it's because the _printExtraInfo
should have been added to DB.prototype._printExtraInfo
.
It works in the sense that the function is executed but it's not logged – for remove(), or any other function that uses _printExtraInfo()
I think it should output the same as if you do db.collection.remove()
> db.test.remove({ a: 2 })
Removed 1 record(s) in 9ms
WriteResult({
"nRemoved": 1
})
Expected behavior
Return the number of delete documents
Actual/current behavior
It deletes the documents but it throws an exception so it doesn't return
Steps to reproduce the actual/current behavior
https://github.com/TylerBrock/mongo-hacker/blob/b67f09417981771be69f2950cc30918533cced9d/hacks/api.js#L173-L187
work on this function was done here: https://github.com/TylerBrock/mongo-hacker/commit/5b2a69a5fd632b2079a7ffc2d4eaff627bf99a74
The function exists here and in my local file as well: https://github.com/TylerBrock/mongo-hacker/blob/b67f09417981771be69f2950cc30918533cced9d/hacks/verbose.js#L6
Environment
mongo
shell