Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongodb:SyntaxError: Unexpected identifier

Tags:

mongodb

mlab

i am new in mongodb. i am creating free database using mongolab. my database name is enron. connecting to mongo database using online mongoshell then error occure.

  mongo ds033499.mongolab.com:33499/enron -u user -p user123

error

  SyntaxError: Unexpected identifier
like image 538
pramod24 Avatar asked Mar 07 '14 07:03

pramod24


1 Answers

Your Syntax is OK. this syntax is for linux shell and didn't work when you are inside mongo shell. you can not connect to remote mongo instance when you are inside mongo shell. perhaps you are trying online shell like this and it is just as you are inside mongoshell:

http://try.mongodb.org/ 

you can connect to instance using linux shell with same syntax, or if you are a windows users you must have mongo administrative shell installed on you windows machines which comes with mongo setup for windows. or you can use GUI tool like Robomongo or Mongo VUE just to access mongo instance.

Or in Windows go to your mongo bin directory and type > mongo.exe --host ipofremote --port 27017

like image 124
Adeel Ahmad Avatar answered Oct 09 '22 03:10

Adeel Ahmad