MongoDB Syntax Error Unexpected Token
mongodb, syntax
Solution
Your query:
test.find() { "_id" : ObjectId(5879b0f65a56a454), "a" : 1 }
Correct query:
test.find( { "_id" : ObjectId("5879b0f65a56a454"), "a" : 1 })
you need to include curly braces in the round brackets like ({}) second thing enclose id in quotes, please refer the mongodb manual
http://docs.mongodb.org/manual/reference/method/db.collection.find/
Problem
I am new to MongoDB. I am just following tutorialspoint.com for learning mongoDB. I executed these two commands exactly as given : ``` db.test.save( { a: 1 } ) db.test.find(){ "_id" : ObjectId(5879b0f65a56a454), "a" : 1 } ``` I am getting error SyntaxError: Unexpected Token { Any help is appreciated. Thanks.