4

I have a mongo DB, in the mongo shell, when I run "show collections", it returns the collection with dot in the collection name like

a.1
a.2
a.3

How I refer it in command like

db.a.1.find()

the above returns SyntaxError: missing ; before statement

smartmeta
  • 1,149
  • 1
  • 17
  • 38
Russel Yang
  • 2,633
  • 3
  • 21
  • 18
  • If you're going to answer your own question, you need to put more effort into explaining why the problem exists. You should expand your answer into *why* it works that way. – SomeKittens Mar 04 '13 at 23:21

1 Answers1

12

figure it out. wrapping it in [ ]. basic javascript knowledge.

db["a.1"].find()
Russel Yang
  • 2,633
  • 3
  • 21
  • 18