Class UpdateOptions


  • public class UpdateOptions
    extends Object
    The options to apply when updating documents.
    • Constructor Detail

      • UpdateOptions

        public UpdateOptions()
    • Method Detail

      • isUpsert

        public boolean isUpsert()
        Returns true if a new document should be inserted if there are no matches to the query filter. The default is false.
        Returns:
        true if a new document should be inserted if there are no matches to the query filter
      • upsert

        public UpdateOptions upsert​(boolean upsert)
        Set to true if a new document should be inserted if there are no matches to the query filter.
        Parameters:
        upsert - true if a new document should be inserted if there are no matches to the query filter.
        Returns:
        this