In the MongoDB shell, how do I list all collections for the current database that I'm using?
相关问题
- MongoDB can not create unique sparse index (duplic
- Spring Data MongoDB - lazy access to some fields
- Golang mongodb aggregation
- How to convert from Timestamp to Mongo ObjectID
- MongoDB Indexing: Multiple single-field vs single
相关文章
- mongodb有没有什么办法禁止读取数据的时候进行缓存
- mongodb-aggregate聚合查询分组后如何获得多字段
- mongodb error: how do I make sure that your journa
- How to track MongoDB requests from a console appli
- MongoError: cannot infer query fields to set, path
- Pymongo $in Query Not Working
- django.core.exceptions.ImproperlyConfigured: '
- How to represent an array with mixed types
First you need to use a database to show all collection/tables inside it.
For switch to the database. by:- use {your_database_name} example:
where friends is the name of your database.
then write:-
this will give you the name of collections.
The following commands on mongoshell are common
Also,
Sometimes it's useful to see all collections as well as the indexes on the collections which are part of the overall namespace:
Here's how you would do that:
Between the 3 commands and this snippet you should be well covered!
The command used for displaying all the collection in the mongoDb database is
Before running the show collections command you have to select the database
To see all the databases you can use the command
For more info visit this link : http://docs.mongodb.org/manual/tutorial/getting-started/
use following command from mongo shell :- show collections
you can use
show tables
orshow collections