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.boolean
Deprecated.ChecksMongoDatabase
for existence of ServerSideJavaScript with given name.Deprecated.Returns names of JavaScript functions that can be called.register
(ExecutableMongoScript script) Deprecated.Store givenExecutableMongoScript
generating a synthetic name so that it can be called by it subsequently.register
(NamedMongoScript script) Deprecated.Registers the givenNamedMongoScript
in the database.
-
Method Details
-
register
Deprecated.Store givenExecutableMongoScript
generating a synthetic name so that it can be called by it subsequently.- Parameters:
script
- must not be null.- Returns:
NamedMongoScript
with name under which theJavaScript
function can be called.
-
register
Deprecated.Registers the givenNamedMongoScript
in the database.- Parameters:
script
- theNamedMongoScript
to 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.ChecksMongoDatabase
for 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
Set
if no scripts found.
-
eval
command has been removed without replacement in MongoDB Server 4.2.0.