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?

Community
  • 1
  • 1
Nikhil
  • 31
  • 1
  • 2
  • 5

1 Answers1

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?

Community
  • 1
  • 1
tschiela
  • 5,231
  • 4
  • 28
  • 35