In general, using db.eval() or the $eval command is a Very Bad idea. The docs should discourage its use, and encourage the use of client-side operations (possibly with projection) instead.
Problems with $eval:
- Acquires the global lock
- Cannot be used in a sharded environment
- Requires __system privilege
- Non-performant since it runs in JavaScript
- related to
-
DOCS-3916 Create stronger warning for db.foo.copyTo()
- Closed