1.直接用shell 操作,手动敲 show tables;
连接 test 数据库 并且显示 test 下的所有 tables

2. 把 show tables 命令传递给 mongo test
echo “show tables” | mongo test

即:
echo “操作语句” | mongo dbName
3. 查询集合中的数据示例
查询 school 集合里的数据。

在shell中把操作mongodb的命令参数传递给mongo
阅读 152
2022-02-26
连接 test 数据库 并且显示 test 下的所有 tables

echo “show tables” | mongo test

即:
echo “操作语句” | mongo dbName
查询 school 集合里的数据。

相关推荐
精彩评论(0)