From 0b427d5eca9398d4ba09bc490f559dbde0ce16f6 Mon Sep 17 00:00:00 2001 From: Mitar Date: Thu, 19 Sep 2019 10:45:34 -0700 Subject: [PATCH] A small optimization when updating documents. --- packages/mongo/collection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mongo/collection.js b/packages/mongo/collection.js index e1f497c861..a610481ba6 100644 --- a/packages/mongo/collection.js +++ b/packages/mongo/collection.js @@ -176,7 +176,7 @@ Object.assign(Mongo.Collection.prototype, { // XXX better specify this interface (not in terms of a wire message)? update(msg) { var mongoId = MongoID.idParse(msg.id); - var doc = self._collection.findOne(mongoId); + var doc = self._collection._docs.get(mongoId); // Is this a "replace the whole doc" message coming from the quiescence // of method writes to an object? (Note that 'undefined' is a valid