driver-legacy/src/main/com/mongodb/DB.java
@Deprecated
    public Object eval(final String code, final Object... args) {
        CommandResult result = doEval(code, args);
        result.throwOnError();
        return result.get("retval");
    }
@Deprecated
    public Object eval(final String code, final Object... args) {
        CommandResult result = doEval(code, args);
        result.throwOnError();
        return result.get("retval");
    }
@ Deprecated public Object eval ( final String code , final Object ... args ) { CommandResult result = doEval ( code , args ) ; result . throwOnError ( ) ; return result . get ( "retval" ) ; }
Calls {@link DB#doEval(java.lang.String, java.lang.Object[]) }. If the command is successful, the "retval" field is extracted and
returned. Otherwise an exception is thrown.

@param code {@code String} representation of JavaScript function
@param args arguments to pass to the JavaScript function
@return result of the execution
@throws MongoException if the operation failed
@mongodb.driver.manual reference/method/db.eval/ db.eval()
@deprecated The eval command was deprecated in MongoDB 3.0
Calls { @link DB#doEval ( java . lang . String java . lang . Object [] ) } . If the command is successful the retval field is extracted and returned . Otherwise an exception is thrown .