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 Summary
Fields Modifier and Type Field Description static CreateIndexCommitQuorum
MAJORITY
A create index commit quorum of majority.static CreateIndexCommitQuorum
VOTING_MEMBERS
A create index commit quorum of voting members.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CreateIndexCommitQuorum
create(int w)
Create a create index commit quorum with a w value.static CreateIndexCommitQuorum
create(String mode)
Create a create index commit quorum with a mode value.abstract BsonValue
toBsonValue()
Converts the create index commit quorum to a Bson value.
-
-
-
Field Detail
-
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 Detail
-
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
-
-