Discussion:
mongo naming conventions/allowances with whitespace
(too old to reply)
mr. me
2018-12-02 22:03:15 UTC
Permalink
Hi all, I am a mongo newbie for sure - and my eyesight reviewing logs for
"whitespace" isn't what it used to be (nor have I learned by lesson to look
for the easiest answer first!) - but this small tweak issue kept pushing me
back to the documentation to make sure I understood the basics, rather than
the underlying cause. I have been too busy googling "mongo multiple
collections with the same name" - with no results in the past few days - so
I haven't googled this particular one...


Anyway - running Mongo 2.6.4 / CentOs 6 / Java Driver 3.1.0;


As I kept debugging / trying to figure out what was going on - I was able
to create multiple collections/tables in the same database with what - in
the mongo cmdln - showed no distinction; (that should have been my first
hint to the issue - but nobody's perfect).

On accident - I created (through java properties files, with
show collections;
*currentSeasoncurrentSeason (+sp.)*

*currentSeason (+sp.+sp.)*
system.indexes
xmlHistory
Should this be considered a "bug(?)" - at a minimum - within the
command-line not showing the differences? I've started out with mongo
without any permissions/schemas/etc. being required as this system is
closed / not really requiring a schema/create admin? If there is some
simple cmd-line / mongo command to quote-delimit, etc. the collections -
I'm good to go; but for newbies messing around, it doesn't lead to a quick
answer.





Thanks, and enjoy!
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/131745d4-29b2-49aa-bac6-e4cf22fedb2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Kevin Adistambha' via mongodb-user
2018-12-04 23:19:47 UTC
Permalink
Hi

Should this be considered a “bug(?)” - at a minimum - within the
command-line not showing the differences?

Personally I don’t see this is as a bug. The spaces are not visible in the show
collections command in the mongo shell, but it is visible in e.g. the
pprint(list(conn.test.list_collections()))
[{'idIndex': {'key': {'_id': 1}, 'name': '_id_', 'ns': 'test.space 1', 'v': 2},
'info': {'readOnly': False,
'uuid': UUID('13302e0c-8eb8-4b8f-981c-76c13f2cf6a0')},
'name': 'space 1',
'options': {},
'type': 'collection'},
{'idIndex': {'key': {'_id': 1}, 'name': '_id_', 'ns': 'test.space 2 ', 'v': 2},
'info': {'readOnly': False,
'uuid': UUID('a6f1a7b2-5c4d-4491-9d54-535ec98c9380')},
'name': 'space 2 ',
'options': {},
'type': 'collection'}]

Note that name: 'space 2 ' has a trailing space that is visible in the
Python output.

Having said that, the ticket SERVER-5002
<https://jira.mongodb.org/browse/SERVER-5002> is describing exactly what
you have. A similar resource is MongoDB Naming Restrictions
<https://docs.mongodb.com/manual/reference/limits/index.html#naming-restrictions>
.

running Mongo 2.6.4 / CentOs 6 / Java Driver 3.1.0;

Note that MongoDB 2.6.4 is very old, out of support, and do not have the
WiredTiger storage engine; thus what you learned on this version might not
be applicable to newer versions of MongoDB. If you’re just starting out
with MongoDB, I would suggest using the newest 4.0.4 version instead.
Please see Install MongoDB Community Edition on Red Hat Enterprise or
CentOS Linux
<https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/>.

Another resource worth learning is the MongoDB University
<https://university.mongodb.com/>, where there are free lessons available
for your perusal.

Best regards,
Kevin
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/e33d056d-b3b8-483e-bc56-4b6103bbcb78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...