mongodb4.2及以后的版本将移除eval命令

Eval has left the building

The eval command itself was deprecated way back at MongoDB 3.0. What’s changed in MongoDB 4.2 is that the Mongo shell now will only accept the db.eval command when working with a 4.0 or earlier server. The eval command went because it no longer made sense to take a global lock on the server when running a script, blocking all operations on the database. Many uses of eval used that global lock to ensure consistency on the database as it ran cross collection transactions. Since 4.0, it’s been more sensible and effective to use MongoDB’s transaction support to get those guarantees without effectively shutting down the server, which is what eval did.

猜你喜欢

转载自blog.csdn.net/xiaohaigary/article/details/107606540