[DOCS-1857] Collection with - in name failed Created: 28/Aug/13 Updated: 11/Jan/17 Resolved: 28/Aug/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 01112017-cleanup |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | HVN | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
mongodb-linux-x86_64-2.4.6 |
||
| Participants: | |
| Days since reply: | 10 years, 25 weeks ago |
| Description |
|
Due to this doc, collection with - in name is okay. But this is what I got: ) ) So this maybe doc bug or core bug? |
| Comments |
| Comment by auto [ 28/Aug/13 ] | |||
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: | |||
| Comment by Sam Kleinman (Inactive) [ 28/Aug/13 ] | |||
|
This is a problem with the JavaScript shell. To specify collections in JavaScript they must be valid SavaScript operations, and the hyphen character is not valid JavaScript in this context. You can use the db.getCollection() method (http://docs.mongodb.org/manual/reference/method/db.getCollection/) as in the following operation to specify collections which have names that are not valid JavaScript symbols:
|