Closed mably closed 7 years ago
Looks like the problem is rather related to my array field query filter and not $pull. Closing.
Found some help here: https://github.com/sergeyksv/tingodb/issues/135
One solution is to enable search in array globally with:
var Db = require('tingodb')( {searchInArray:true}).Db.
Though it still doens't seem to work with _id
values, had to convert them to string using _id + ''
Here is my code, I'm trying to implement two-phase commit from MongoDb documentation :
It looks like $pull doesn't work on my side, the txid is never removed from the pendingTransactions collection.
Am I doing something wrong?
Thanx for your help.
EDIT: it looks like the problem is with the
pendingTransactions: txid
part of the query selector, don't know why though. Is it possible to filter an update by a collection field value?