org.springframework.data.mongodb.core.script

Class NamedMongoScript

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


  • public class NamedMongoScript
    extends Object
    An ExecutableMongoScript assigned to a name that allows calling the function by its name once it has been saved to the DB instance.
    Since:
    1.7
    Author:
    Christoph Strobl, Oliver Gierke
    • Constructor Detail

      • NamedMongoScript

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

      • getCode

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

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