Skip to content

Commit

Permalink
Change LinkMany to use $pullAll instead of $pull
Browse files Browse the repository at this point in the history
This is a workaround for a limitation in the minimongo
implementation of $pull that triggers an "Error:
Unrecognized logical operator: $in" when removing an
id from a list of ids.
  • Loading branch information
doronrk committed Nov 4, 2019
1 parent 8c9d1e8 commit c65870c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/links/linkTypes/linkMany.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export default class LinkMany extends Link {

// update the db
let modifier = {
$pull: {
[root]: nested.length > 0 ? {[nested.join('.')]: {$in: _ids}} : {$in: _ids},
$pullAll: {
[root]: nested.length > 0 ? { [nested.join('.')]: _ids } : _ids,
},
};

Expand Down

0 comments on commit c65870c

Please sign in to comment.