Skip to content

Commit

Permalink
fix(update): Fixes the mongo selector in the update call if invoked w…
Browse files Browse the repository at this point in the history
…ith ObjectID only
  • Loading branch information
plbkbx committed Dec 11, 2024
1 parent 9b140bb commit f17a838
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mongo/Mutator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from "./lib/dispatchers";
import Config from "../config";
import { Events } from "../constants";
import { Mongo } from 'meteor/mongo';

function runCallbackInBackground(fn) {
Meteor.defer(Meteor.bindEnvironment(fn));
Expand Down Expand Up @@ -107,7 +108,7 @@ export default class Mutator {
* @returns {*}
*/
static async update(Originals, selector, modifier, _config, callback) {
if (_.isString(selector)) {
if (_.isString(selector) || selector instanceof Mongo.ObjectID) {
selector = { _id: selector };
}

Expand Down

0 comments on commit f17a838

Please sign in to comment.