Package com.mongodb

Class CreateIndexCommitQuorum

java.lang.Object
com.mongodb.CreateIndexCommitQuorum

public abstract class CreateIndexCommitQuorum extends Object
A commit quorum specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready.
Since:
4.1
MongoDB documentation
Create indexes
Since server release
4.4
  • Field Details

    • MAJORITY

      public static final CreateIndexCommitQuorum MAJORITY
      A create index commit quorum of majority.
    • VOTING_MEMBERS

      public static final CreateIndexCommitQuorum VOTING_MEMBERS
      A create index commit quorum of voting members.
  • Method Details

    • create

      public static CreateIndexCommitQuorum create(String mode)
      Create a create index commit quorum with a mode value.
      Parameters:
      mode - the mode value
      Returns:
      a create index commit quorum of the specified mode
    • create

      public static CreateIndexCommitQuorum create(int w)
      Create a create index commit quorum with a w value.
      Parameters:
      w - the w value
      Returns:
      a create index commit quorum with the specified w value
    • toBsonValue

      public abstract BsonValue toBsonValue()
      Converts the create index commit quorum to a Bson value.
      Returns:
      the BsonValue that represents the create index commit quorum