在特定的MongoDB数据库中显示集合?
首先,使用USE命令切换到MongoDB中的特定数据库,如以下语法所示:
use yourDatabaseName; db.getCollectionNames();
让我们实现以上语法以显示数据库WEB的集合-
> use web; switched to db web > db.getCollectionNames();
这将产生以下输出-
[ "2015-myCollection", "2015-yourCollection", "2019-employeeCollection", "addColumnDemo", "applyConditionDemo", "calculateAverage", "calculateSumOfDocument", "changeSimpleFieldDemo", "check", "checkFieldDemo", "collationExample", "compoundIndexDemo", "countandsumdemo", "creatingAliasDemo", "decreasetimeusingindex", "demo1", "demo10", "demo11", "demo12", "demo13", "demo14", "demo15", "demo16", "demo17", "demo18", "demo19", "demo2", "demo20", "demo21", "demo22", "demo23", "demo24", "demo25", "demo26", "demo27", "demo28.example", "demo29", "demo3", "demo30", "demo31", "demo32", "demo33", "demo34", "demo35", "demo36", "demo37", "demo38", "demo39", "demo4", "demo5", "demo6", "demo7", "demo8", "demo9", "destinationCollection", "emp_info", "emptyCollection", "extractParticularElementDemo", "getSpecificData", "getTheMaxValueDemo", "indexCreationDemo", "missingDocumentDemo", "promoteSubfieldsDemo", "pullWithPositionalOperatorDemo", "removeNullDemo", "replacevaluedemo", "searchDocumentsDemo", "searchSubFieldDemo", "sourceCollection", "splitString", "testInArray", "twoSpecificIdsDemo", "updatingDemo", "version" ]
热门推荐
1 如何训练狗狗不叫
2 训练狗狗不叫
3 训练狗狗随行
4 怎么训练狗狗不叫
7 训练比熊狗狗教程
10 上海狗狗训练
11 怎么训练狗狗上厕所
12 训练狗狗趴下
13 狗狗服从训练
14 训练狗狗拒食
15 训练狗狗笑
16 训练狗狗大便
17 训练狗狗立
18 训练狗狗捡东西