Open OliverColeman opened 4 years ago
I think the docs represent the original intention, but if an update uses a query in the selector, it will be used instead as a result of this code:
} else if (type === "update" && selector) {
docId = typeof selector === 'string' || selector instanceof Mongo.ObjectID ? selector : selector._id;
}
Not sure what the "correct" behaviour here should look like
Want to make a PR to update the docs?
Is this the correct behavior? I would think the property should be made to always return a document id, as documented, and intuitively.
Just spent some time figuring out why a
findOne(this.docId)
in anautoValue
function was causing an error. The documentation forthis.docId
saysdocId: The _id property of the document being inserted or updated
but it turns out it's not just the_id
of the document, it's a filter query like{ '$in': [ 'rg8gSYhGaNQaJ3X8p' ] }
.