Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在关于MongoDB 3.x 弃用 eval() 函数(应该如此)的讨论之后,我想知道是否有任何计划也弃用 --eval() 命令行参数的可用性,例如:
mongo --eval('db.getCollection("aaa").count();')
谢谢
不,我认为它不会被弃用。使用时没有弃用警告mongo --eval=。
mongo --eval=
弃用是关于 MongoDB 命令db.eval(),而mongo --eval=它是一个 shell 命令——即在解释器中执行传递代码的指令,您可以在其中手动运行它。
db.eval()