src/League/Monga/Database.php
public function executeCode($code, array $arguments = [])
    {
        if (! ($code instanceof MongoCode)) {
            $code = new MongoCode($code);
        }

        return $this->database->execute($code, $arguments);
    }
public function executeCode($code, array $arguments = [])
    {
        if (! ($code instanceof MongoCode)) {
            $code = new MongoCode($code);
        }

        return $this->database->execute($code, $arguments);
    }
public function executeCode ( $ code , array $ arguments = [ ] ) { if ( ! ( $ code instanceof MongoCode ) ) { $ code = new MongoCode ( $ code ) ; } return $ this -> database -> execute ( $ code , $ arguments ) ; }
Execute javascript on the database

@param mixed $code      MongoCode or javascript string
@param array $arguments function arguments

@return mixed result
Execute javascript on the database