Interface ScriptOperations
Deprecated.
Script operations on
MongoDatabase level. Allows interaction with server side JavaScript functions.- Since:
- 1.7
- Author:
- Christoph Strobl, Oliver Gierke
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Call the JavaScript by its name.execute(ExecutableMongoScript script, Object... args) Deprecated.Executes the script by either calling it via its name or directly sending it.booleanDeprecated.ChecksMongoDatabasefor existence of ServerSideJavaScript with given name.Deprecated.Returns names of JavaScript functions that can be called.register(ExecutableMongoScript script) Deprecated.Store givenExecutableMongoScriptgenerating a synthetic name so that it can be called by it subsequently.register(NamedMongoScript script) Deprecated.Registers the givenNamedMongoScriptin the database.
-
Method Details
-
register
Deprecated.Store givenExecutableMongoScriptgenerating a synthetic name so that it can be called by it subsequently.- Parameters:
script- must not be null.- Returns:
NamedMongoScriptwith name under which theJavaScriptfunction can be called.
-
register
Deprecated.Registers the givenNamedMongoScriptin the database.- Parameters:
script- theNamedMongoScriptto be registered.- Returns:
-
execute
Deprecated.Executes the script by either calling it via its name or directly sending it.- Parameters:
script- must not be null.args- arguments to pass on for script execution.- Returns:
- the script evaluation result.
- Throws:
DataAccessException
-
call
Deprecated.Call the JavaScript by its name.- Parameters:
scriptName- must not be null or empty.args-- Returns:
-
exists
Deprecated.ChecksMongoDatabasefor existence of ServerSideJavaScript with given name.- Parameters:
scriptName- must not be null or empty.- Returns:
- false if no ServerSideJavaScript with given name exists.
-
getScriptNames
Deprecated.Returns names of JavaScript functions that can be called.- Returns:
- empty
Setif no scripts found.
-
evalcommand has been removed without replacement in MongoDB Server 4.2.0.