MongoDB 中 SQL 'SELECT * FROM ...' 的等效方法
而在 SQL 中你可能运行
select_all.sql
SELECT * FROM mytable;查看表中的所有条目,你可以运行
mongo_find_example.js
db.getCollection("mytable").find({})在 MongoDB 中。另请参见官方 SQL 到 MongoDB 映射图表。
要运行该命令(假设 mongod 的默认配置),你可以运行
mongo_shell_cmd.sh
mongo [name of database]在你喜欢的 shell 中。
Check out similar posts by category:
Databases
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow