3

I am getting an error

SyntaxError: Unexpected token ILLEGAL

when I am trying to execute the command in mongoDB

db.17feb.find()

I read a POST saying that names cannot start with numbers, but now as collection is already created and data exists in it, how can i retrieve using command? I am getting data when i am retrieving the data through java code

Can any1 help?

1 Answer 1

9

You can call object attributes with dot notation and square brackets. So try that:

db['17feb'].find();

edit

May that is a dube to that answer: MongoDB Shell - access collection with period in name?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.