Package com.mongodb.client.model
Class CreateIndexOptions
-
- com.mongodb.client.model.CreateIndexOptions
-
public class CreateIndexOptions extends
The options to apply to the command when creating indexes.- Since:
- 3.6
- MongoDB documentation
-
-
Constructor Summary
Constructors Constructor Description CreateIndexOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
timeUnit)
Gets the maximum execution time on the server for this operation.CreateIndexOptions
maxTime(long maxTime, timeUnit)
Sets the maximum execution time on the server for this operation.toString()
-
-
-
Method Detail
-
getMaxTime
public long getMaxTime( timeUnit)
Gets the maximum execution time on the server for this operation. The default is 0, which places no limit on the execution time.- Parameters:
timeUnit
- the time unit to return the result in- Returns:
- the maximum execution time in the given time unit
-
maxTime
public CreateIndexOptions maxTime(long maxTime, timeUnit)
Sets the maximum execution time on the server for this operation.- Parameters:
maxTime
- the max timetimeUnit
- the time unit, which may not be null- Returns:
- this
-
toString
public toString()
- Overrides:
in class
-
-