Class MongoClientUpdateResult


  • public class MongoClientUpdateResult
    extends Object
    Result propagated from mongodb driver update result.
    Author:
    Maziz Esa
    • Field Detail

      • DEFAULT_DOCMATCHED

        public static final long DEFAULT_DOCMATCHED
        The default value is 0, signifying no match
        See Also:
        Constant Field Values
      • DEFAULT_DOCMODIFIED

        public static final long DEFAULT_DOCMODIFIED
        The default value is 0, signifying no document is modified
        See Also:
        Constant Field Values
      • DOC_MATCHED

        public static final String DOC_MATCHED
        Constant to be used when storing and retrieving Json for documents matched.
        See Also:
        Constant Field Values
      • UPSERTED_ID

        public static final String UPSERTED_ID
        Constant to be used when storing and retrieving Json for documents upserted id.
        See Also:
        Constant Field Values
      • DOC_MODIFIED

        public static final String DOC_MODIFIED
        Constant to be used when storing and retrieving Json for documents modified.
        See Also:
        Constant Field Values
      • ID_FIELD

        public static final String ID_FIELD
        Constant to be used when storing and retrieving the _id within upserted_id
        See Also:
        Constant Field Values
    • Constructor Detail

      • MongoClientUpdateResult

        public MongoClientUpdateResult()
        Default constructor
      • MongoClientUpdateResult

        public MongoClientUpdateResult​(long docMatched,
                                       JsonObject docUpsertedId,
                                       long docModified)
        Constructor to specify the status of the operation. Number of matched, upserted id JsonObject and number of doc modified.
        Parameters:
        docMatched -
        docUpsertedId -
        docModified -
      • MongoClientUpdateResult

        public MongoClientUpdateResult​(MongoClientUpdateResult mongoClientUpdateResultCopy)
        Copy constructor
        Parameters:
        mongoClientUpdateResultCopy -
      • MongoClientUpdateResult

        public MongoClientUpdateResult​(JsonObject mongoClientUpdateResultJson)
        Constructor from JSON
        Parameters:
        mongoClientUpdateResultJson -
    • Method Detail

      • toJson

        public JsonObject toJson()
        Convert to JSON
        Returns:
        the JSON
      • getDocMatched

        public long getDocMatched()
        Get the number of documents that're matched
        Returns:
        number of documents that're matched
      • getDocUpsertedId

        public JsonObject getDocUpsertedId()
        Get the document id that's upserted
        Returns:
        document id that's upserted
      • getDocModified

        public long getDocModified()
        Get the number of documents that're modified
        Returns:
        number of documents that're modified
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object