Answer the question
In order to leave comments, you need to log in
How to add a collection to mongodb?
There is a server on a node with authorization, I communicate with the database through mongoose. I want to make an editable list for each user. If I understand correctly, I need to make an additional collection to the existing database. Actually, how to do it? Will there be a conflict with the login data collection?
Answer the question
In order to leave comments, you need to log in
In mongo, collections, like the bases themselves, are added on the fly, on-demand.
MongoDB shell version: 2.4.9
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
> db.getCollectionNames()
[ ]
> db.foo.insert({})
> db.getCollectionNames()
[ "foo", "system.indexes" ]
>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question