You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The version of Meteor showing the problem.
Meteor version: 1.5.1
Packages updated:
accounts-base upgraded from 1.3.1 to 1.3.2
babel-compiler upgraded from 6.19.4 to 6.20.0
boilerplate-generator upgraded from 1.1.1 to 1.2.0
ddp-client upgraded from 2.0.0 to 2.1.0
ejson upgraded from 1.0.13 to 1.0.14
minifier-js upgraded from 2.1.1 to 2.1.2
minimongo upgraded from 1.2.1 to 1.3.0
modules upgraded from 0.9.4 to 0.10.0
mongo upgraded from 1.1.22 to 1.2.0
mongo-dev-server added, version 1.0.1
promise upgraded from 0.8.9 to 0.9.0
webapp upgraded from 1.3.17 to 1.3.18
The last version of Meteor where the problem did not occur (if applicable)
Same version before the update.
The operating system you're running Meteor on.
MacOs, but problem also occurs on Ubuntu 16.04.2 LTS Linux local and production.
The expected behavior
Before the update there were no problems with calling collection.findOne("") or collection.findOne({_id:""}). I expect the function findOne to return a falsey value, such as null or undefined.
The actual behavior.
Throws error on collection.findOne({_id:""})
Error: Meteor does not currently support objects other than ObjectID as ids
idStringify — 436bf8d602463537fc560f5794e92e560aa45dc0.js:56258
get — 436bf8d602463537fc560f5794e92e560aa45dc0.js:56013
e — 436bf8d602463537fc560f5794e92e560aa45dc0.js:57512
e — 436bf8d602463537fc560f5794e92e560aa45dc0.js:57443:156
e — 436bf8d602463537fc560f5794e92e560aa45dc0.js:57495
e — 436bf8d602463537fc560f5794e92e560aa45dc0.js:57393
e — 436bf8d602463537fc560f5794e92e560aa45dc0.js:45:14769
e — 436bf8d602463537fc560f5794e92e560aa45dc0.js:57658:119
findOne — 436bf8d602463537fc560f5794e92e560aa45dc0.js:62014
Is this behavior to be expected now with the updated packages?
I checked the mongo 2.6 merge and it seems, that it introduces new _id handling?
A simple reproduction!
Create a new Meteor project with the above package versions and call findOne({_id:""}) on a arbitrary client side collection.
The text was updated successfully, but these errors were encountered:
Here is a reproduction repo: https://github.com/klaussner/meteor-issues/tree/9060. It looks like this bug was introduced in #8893, specifically by this commit. The following line assigns the selector object instead of the _id to this._selectorId if the _id in the selector object is an empty string:
Uncaught Error: Meteor does not currently support objects other than ObjectID as ids
at _IdMap.MongoID.idStringify [as _idStringify] (mongo-id.js?hash=345d169d517353f8146292b4abd24061721f8b26:104)
at _IdMap.get (id-map.js?hash=c7aea8dfa2bf46ff2ae0aa6c6cf09e36abc61d07:46)
at Cursor._getRawObjects (cursor.js:377)
at Cursor.forEach (cursor.js:103)
at Cursor.fetch (cursor.js:68)
at LocalCollection.findOne (local_collection.js:86)
at Mongo.Collection.findOne (collection.js:334)
at index.js (index.js:4)
at fileEvaluate (modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:343)
at require (modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:238)
The version of Meteor showing the problem.
Meteor version: 1.5.1
Packages updated:
The last version of Meteor where the problem did not occur (if applicable)
Same version before the update.
The operating system you're running Meteor on.
MacOs, but problem also occurs on Ubuntu 16.04.2 LTS Linux local and production.
The expected behavior
Before the update there were no problems with calling
collection.findOne("")
orcollection.findOne({_id:""})
. I expect the functionfindOne
to return a falsey value, such as null or undefined.The actual behavior.
Throws error on
collection.findOne({_id:""})
Is this behavior to be expected now with the updated packages?
I checked the mongo 2.6 merge and it seems, that it introduces new _id handling?
A simple reproduction!
Create a new Meteor project with the above package versions and call findOne({_id:""}) on a arbitrary client side collection.
The text was updated successfully, but these errors were encountered: