Class Variable<TExpression>

  • Type Parameters:
    TExpression - the type of the value for the new variable

    public class Variable<TExpression>
    extends Object
    Helps define new variable for the $lookup pipeline stage
    Since:
    3.7
    MongoDB documentation
    $lookup
    Since server release
    3.6
    • Constructor Detail

      • Variable

        public Variable​(String name,
                        TExpression value)
        Creates a new variable definition for use in $lookup pipeline stages
        Parameters:
        name - the name of the new variable
        value - the value of the new variable
        MongoDB documentation
        $lookup
    • Method Detail

      • getName

        public String getName()
        Returns:
        the name of the new variable
      • getValue

        public TExpression getValue()
        Returns:
        the value of the new variable
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object