Class NamedMongoScript

java.lang.Object
org.springframework.data.mongodb.core.script.NamedMongoScript

@Deprecated public class NamedMongoScript extends Object
Deprecated.
since 2.2. The eval command has been removed without replacement in MongoDB Server 4.2.0.
An ExecutableMongoScript assigned to a name that allows calling the function by its name once it has been saved to the MongoDatabase instance.
Since:
1.7
Author:
Christoph Strobl, Oliver Gierke
  • Constructor Details

    • NamedMongoScript

      public NamedMongoScript(String name, String rawScript)
      Deprecated.
      Creates new NamedMongoScript that can be saved to the MongoDatabase instance.
      Parameters:
      name - must not be null or empty.
      rawScript - the String representation of the JavaScript function. Must not be null or empty.
    • NamedMongoScript

      public NamedMongoScript(String name, ExecutableMongoScript script)
      Deprecated.
      Creates new NamedMongoScript.
      Parameters:
      name - must not be null or empty.
      script - must not be null.
  • Method Details

    • getCode

      public String getCode()
      Deprecated.
      Returns the actual script code.
      Returns:
      will never be null.
    • getScript

      public ExecutableMongoScript getScript()
      Deprecated.
      Returns the underlying ExecutableMongoScript.
      Returns:
      will never be null.
    • getName

      public String getName()
      Deprecated.
      Returns the name of the script.
      Returns:
      will never be null or empty.