Class CodeWithScope

java.lang.Object
org.bson.types.Code
org.bson.types.CodeWithScope
All Implemented Interfaces:
Serializable

public class CodeWithScope extends Code
A representation of the JavaScript Code with Scope BSON type.
Since:
3.0
See Also:
  • Constructor Details

    • CodeWithScope

      public CodeWithScope(String code, Document scope)
      Construct an instance.
      Parameters:
      code - the code
      scope - the scope
  • Method Details

    • getScope

      public Document getScope()
      Gets the scope, which is a mapping from identifiers to values, representing the scope in which the code should be evaluated.
      Returns:
      the scope
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Code
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Code