Reputation: 5685
In my browser console Posts
works, but I get errors with legitimate _id
values with find()
or findOne()
:
Posts.findOne({_id: 5FSZhpYDcq4XWkTva})
VM10024:2 Uncaught SyntaxError: Unexpected identifier
at Object.InjectedScript._evaluateOn (<anonymous>:895:140)
at Object.InjectedScript._evaluateAndWrap (<anonymous>:828:34)
at Object.InjectedScript.evaluate (<anonymous>:694:21)
Upvotes: 0
Views: 97
Reputation: 640
I couldn't recreate that exact error, but I noticed you don't have quotes around the _id you are searching for.
So instead of this:
Posts.findOne({_id: 5FSZhpYDcq4XWkTva})
try:
Posts.findOne({_id: '5FSZhpYDcq4XWkTva'})
Upvotes: 2