public interface ScriptOperations
DB level. Allows interaction with server side JavaScript functions.| Modifier and Type | Method and Description |
|---|---|
Object |
call(String scriptName,
Object... args)
Call the JavaScript by its name.
|
Object |
execute(ExecutableMongoScript script,
Object... args)
Executes the script by either calling it via its name or directly sending it.
|
boolean |
exists(String scriptName)
Checks
DB for existence of ServerSideJavaScript with given name. |
Set<String> |
getScriptNames()
Returns names of JavaScript functions that can be called.
|
NamedMongoScript |
register(ExecutableMongoScript script)
Store given
ExecutableMongoScript generating a syntheitcal name so that it can be called by it
subsequently. |
NamedMongoScript |
register(NamedMongoScript script)
Registers the given
NamedMongoScript in the database. |
NamedMongoScript register(ExecutableMongoScript script)
ExecutableMongoScript generating a syntheitcal name so that it can be called by it
subsequently.script - must not be null.NamedMongoScript with name under which the JavaScript function can be called.NamedMongoScript register(NamedMongoScript script)
NamedMongoScript in the database.script - the NamedMongoScript to be registered.@Nullable Object execute(ExecutableMongoScript script, Object... args)
script - must not be null.args - arguments to pass on for script execution.DataAccessException@Nullable Object call(String scriptName, Object... args)
scriptName - must not be null or empty.args - boolean exists(String scriptName)
DB for existence of ServerSideJavaScript with given name.scriptName - must not be null or empty.ServerSideJavaScript with given name exists.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.