Class MergeOptions

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MergeOptions.WhenMatched
      The behavior of $merge if a result document and an existing document in the collection have the same value for the specified on field(s).
      static class  MergeOptions.WhenNotMatched
      The behavior of $merge if a result document does not match an existing document in the out collection.
    • Constructor Summary

      Constructors 
      Constructor Description
      MergeOptions()  
    • Constructor Detail

      • MergeOptions

        public MergeOptions()
    • Method Detail

      • getUniqueIdentifier

        public <> getUniqueIdentifier()
        Gets the fields that act as a unique identifier for a document. The identifier determine if a results document matches an already existing document in the output collection.
        Returns:
        the unique identifier
      • uniqueIdentifier

        public  uniqueIdentifier)
        Sets the field that act as a unique identifier for a document. The identifier determine if a results document matches an already existing document in the output collection.
        Parameters:
        uniqueIdentifier - the unique identifier
        Returns:
        this
      • uniqueIdentifier

        public <> uniqueIdentifier)
        Sets the field that act as a unique identifier for a document. The identifier determine if a results document matches an already existing document in the output collection.
        Parameters:
        uniqueIdentifier - the unique identifier
        Returns:
        this
      • getWhenMatched

        public MergeOptions.WhenMatched getWhenMatched()
        Gets the behavior of $merge if a result document and an existing document in the collection have the same value for the specified on field(s).
        Returns:
        when matched
      • whenMatched

        public MergeOptions whenMatched​(MergeOptions.WhenMatched whenMatched)
        Sets the behavior of $merge if a result document and an existing document in the collection have the same value for the specified on field(s).
        Parameters:
        whenMatched - when matched
        Returns:
        this
      • getVariables

        public <Variable<?>> getVariables()
        Gets the variables accessible for use in the whenMatched pipeline
        Returns:
        the variables
      • variables

        public <Variable<?>> variables)
        Sets the variables accessible for use in the whenMatched pipeline.
        Parameters:
        variables - the variables
        Returns:
        this
      • getWhenMatchedPipeline

        public <Bson> getWhenMatchedPipeline()
        Gets aggregation pipeline to update the document in the collection.
        Returns:
        when matched pipeline
        See Also:
        MergeOptions.WhenMatched.PIPELINE
      • whenMatchedPipeline

        public <Bson> whenMatchedPipeline)
        Sets aggregation pipeline to update the document in the collection.
        Parameters:
        whenMatchedPipeline - when matched pipeline
        Returns:
        this
        See Also:
        MergeOptions.WhenMatched.PIPELINE
      • getWhenNotMatched

        public MergeOptions.WhenNotMatched getWhenNotMatched()
        Gets the behavior of $merge if a result document does not match an existing document in the out collection.
        Returns:
        when not matched
      • whenNotMatched

        public MergeOptions whenNotMatched​(MergeOptions.WhenNotMatched whenNotMatched)
        Sets the behavior of $merge if a result document does not match an existing document in the out collection.
        Parameters:
        whenNotMatched - when not matched
        Returns:
        this
      • equals

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

        public int hashCode()
        Overrides:
         in class 
      • toString

        public  toString()
        Overrides:
         in class