remove() helper exception - _printExtraInfo is not a function
gianpaj opened this issue · comments
Gîanfranco P commented
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
db.collection.find({a : 1}).remove()
uncaught exception: TypeError: this._db._printExtraInfo is not a function :
DBQuery.prototype.remove@/Users/gpalumbo/.mongorc.js:462:5
@(shell):1:1
Lines 173 to 187 in b67f094
work on this function was done here:
5b2a69a
The function exists here and in my local file as well:
Line 6 in b67f094
Environment
Software | Version |
---|---|
Mongo Hacker | 0.1.1 |
mongo shell |
v4.4.10 |
MongoDB server | 4.4.8 |
Operating system | macos |
Gîanfranco P commented
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
})