Class ReplaceOptions

java.lang.Object
org.springframework.data.mongodb.core.ReplaceOptions
Direct Known Subclasses:
FindAndReplaceOptions

public class ReplaceOptions extends Object
Options for replace operations. Defaults to
upsert
false
Since:
4.2
Author:
Jakub Zurawa, Christoph Strob
  • Constructor Details

    • ReplaceOptions

      public ReplaceOptions()
  • Method Details

    • replaceOptions

      public static ReplaceOptions replaceOptions()
      Static factory method to create a ReplaceOptions instance.
      upsert
      false
      Returns:
      new instance of ReplaceOptions.
    • none

      public static ReplaceOptions none()
      Static factory method returning an unmodifiable ReplaceOptions instance.
      Returns:
      unmodifiable ReplaceOptions instance.
    • upsert

      public ReplaceOptions upsert()
      Insert a new document if not exists.
      Returns:
      this.
    • isUpsert

      public boolean isUpsert()
      Get the bit indicating if to create a new document if not exists.
      Returns:
      true if set.