Package com.mongodb.client.model
Class FindOptions
java.lang.Object
com.mongodb.client.model.FindOptions
Deprecated.
there is no replacement for this class
The options to apply to a find operation (also commonly referred to as a query).
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Construct a new instance.FindOptions
(FindOptions from) Deprecated.this constructor is unused -
Method Summary
Modifier and TypeMethodDescriptionbatchSize
(int batchSize) Deprecated.Sets the number of documents to return per batch.Deprecated.Sets the collation optionsDeprecated.Sets the comment to the query.cursorType
(CursorType cursorType) Deprecated.Sets the cursor type.int
Deprecated.Gets the number of documents to return per batch.Deprecated.Returns the collation optionsDeprecated.Returns the comment to send with the query.Deprecated.Get the cursor type.getHint()
Deprecated.Returns the hint for which index to use.Deprecated.Gets the hint string to apply.int
getLimit()
Deprecated.Gets the limit to apply.getMax()
Deprecated.Returns the exclusive upper bound for a specific index.long
getMaxAwaitTime
(TimeUnit timeUnit) Deprecated.The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.long
Deprecated.Deprecated as of MongoDB 4.0 releaselong
getMaxTime
(TimeUnit timeUnit) Deprecated.Gets the maximum execution time on the server for this operation.getMin()
Deprecated.Returns the minimum inclusive lower bound for a specific index.Deprecated.use the individual modifier methods instead.Deprecated.Gets a document describing the fields to return for all matching documents.int
getSkip()
Deprecated.Gets the number of documents to skip.getSort()
Deprecated.Gets the sort criteria to apply to the query.Deprecated.Sets the hint for which index to use.hintString
(String hint) Deprecated.Sets the hint to apply.boolean
Deprecated.The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use.boolean
Deprecated.Users should not set this under normal circumstances.boolean
Deprecated.Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).boolean
Deprecated.Returns the returnKey.boolean
Deprecated.Returns the showRecordId.boolean
Deprecated.Deprecated in MongoDB 3.6 release and removed in MongoDB 4.0 releaselimit
(int limit) Deprecated.Sets the limit to apply.Deprecated.Sets the exclusive upper bound for a specific index.maxAwaitTime
(long maxAwaitTime, TimeUnit timeUnit) Deprecated.Sets the maximum await execution time on the server for this operation.maxScan
(long maxScan) Deprecated.Deprecated as of MongoDB 4.0 releaseDeprecated.Sets the maximum execution time on the server for this operation.Deprecated.Sets the minimum inclusive lower bound for a specific index.Deprecated.use the individual modifier methods instead.noCursorTimeout
(boolean noCursorTimeout) Deprecated.The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use.oplogReplay
(boolean oplogReplay) Deprecated.Users should not set this under normal circumstances.partial
(boolean partial) Deprecated.Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).projection
(Bson projection) Deprecated.Sets a document describing the fields to return for all matching documents.returnKey
(boolean returnKey) Deprecated.Sets the returnKey.showRecordId
(boolean showRecordId) Deprecated.Sets the showRecordId.skip
(int skip) Deprecated.Sets the number of documents to skip.snapshot
(boolean snapshot) Deprecated.Deprecated in MongoDB 3.6 release and removed in MongoDB 4.0 releaseDeprecated.Sets the sort criteria to apply to the query.toString()
Deprecated.
-
Constructor Details
-
FindOptions
public FindOptions()Deprecated.Construct a new instance. -
FindOptions
Deprecated.this constructor is unusedConstruct a new instance by making a shallow copy of the given model.- Parameters:
from
- model to copy
-
-
Method Details
-
getLimit
public int getLimit()Deprecated.Gets the limit to apply. The default is null.- Returns:
- the limit
-
limit
Deprecated.Sets the limit to apply.- Parameters:
limit
- the limit, which may be null- Returns:
- this
-
getSkip
public int getSkip()Deprecated.Gets the number of documents to skip. The default is 0.- Returns:
- the number of documents to skip
-
skip
Deprecated.Sets the number of documents to skip.- Parameters:
skip
- the number of documents to skip- Returns:
- this
-
getMaxTime
Deprecated.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
Deprecated.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
-
getMaxAwaitTime
Deprecated.The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. This only applies to a TAILABLE_AWAIT cursor. When the cursor is not a TAILABLE_AWAIT cursor, this option is ignored. On servers >= 3.2, this option will be specified on the getMore command as "maxTimeMS". The default is no value: no "maxTimeMS" is sent to the server with the getMore command. On servers < 3.2, this option is ignored, and indicates that the driver should respect the server's default value A zero value will be ignored.- Parameters:
timeUnit
- the time unit to return the result in- Returns:
- the maximum await execution time in the given time unit
- Since:
- 3.2
-
maxAwaitTime
Deprecated.Sets the maximum await execution time on the server for this operation.- Parameters:
maxAwaitTime
- the max await time. A zero value will be ignored, and indicates that the driver should respect the server's default valuetimeUnit
- the time unit, which may not be null- Returns:
- this
- Since:
- 3.2
-
getBatchSize
public int getBatchSize()Deprecated.Gets the number of documents to return per batch. Default to 0, which indicates that the server chooses an appropriate batch size.- Returns:
- the batch size
-
batchSize
Deprecated.Sets the number of documents to return per batch.- Parameters:
batchSize
- the batch size- Returns:
- this
-
getModifiers
Deprecated.use the individual modifier methods instead.Gets the query modifiers to apply to this operation. The default is not to apply any modifiers.- Returns:
- the query modifiers, which may be null
-
modifiers
Deprecated.use the individual modifier methods instead.Sets the query modifiers to apply to this operation.- Parameters:
modifiers
- the query modifiers to apply, which may be null.- Returns:
- this
-
getProjection
Deprecated.Gets a document describing the fields to return for all matching documents.- Returns:
- the project document, which may be null
-
projection
Deprecated.Sets a document describing the fields to return for all matching documents.- Parameters:
projection
- the project document, which may be null.- Returns:
- this
-
getSort
Deprecated.Gets the sort criteria to apply to the query. The default is null, which means that the documents will be returned in an undefined order.- Returns:
- a document describing the sort criteria
-
sort
Deprecated.Sets the sort criteria to apply to the query.- Parameters:
sort
- the sort criteria, which may be null.- Returns:
- this
-
isNoCursorTimeout
public boolean isNoCursorTimeout()Deprecated.The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. If true, that timeout is disabled.- Returns:
- true if cursor timeout is disabled
-
noCursorTimeout
Deprecated.The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.- Parameters:
noCursorTimeout
- true if cursor timeout is disabled- Returns:
- this
-
isOplogReplay
public boolean isOplogReplay()Deprecated.Users should not set this under normal circumstances.- Returns:
- if oplog replay is enabled
-
oplogReplay
Deprecated.Users should not set this under normal circumstances.- Parameters:
oplogReplay
- if oplog replay is enabled- Returns:
- this
-
isPartial
public boolean isPartial()Deprecated.Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).- Returns:
- if partial results for sharded clusters is enabled
-
partial
Deprecated.Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).- Parameters:
partial
- if partial results for sharded clusters is enabled- Returns:
- this
-
getCursorType
Deprecated.Get the cursor type.- Returns:
- the cursor type
-
cursorType
Deprecated.Sets the cursor type.- Parameters:
cursorType
- the cursor type- Returns:
- this
-
getCollation
Deprecated.Returns the collation options- Returns:
- the collation options
- Since:
- 3.4
-
collation
Deprecated.Sets the collation optionsA null value represents the server default.
- Parameters:
collation
- the collation options to use- Returns:
- this
- Since:
- 3.4
-
getComment
Deprecated.Returns the comment to send with the query. The default is not to include a comment with the query.- Returns:
- the comment
- Since:
- 3.5
-
comment
Deprecated.Sets the comment to the query. A null value means no comment is set.- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 3.5
-
getHint
Deprecated.Returns the hint for which index to use. The default is not to set a hint.- Returns:
- the hint
- Since:
- 3.5
-
hint
Deprecated.Sets the hint for which index to use. A null value means no hint is set.- Parameters:
hint
- the hint- Returns:
- this
- Since:
- 3.5
-
getHintString
Deprecated.Gets the hint string to apply.- Returns:
- the hint string, which should be the name of an existing index
- Since:
- 3.12
-
hintString
Deprecated.Sets the hint to apply.- Parameters:
hint
- the name of the index which should be used for the operation- Returns:
- this
- Since:
- 3.12
-
getMax
Deprecated.Returns the exclusive upper bound for a specific index. By default there is no max bound.- Returns:
- the max
- Since:
- 3.5
-
max
Deprecated.Sets the exclusive upper bound for a specific index. A null value means no max is set.- Parameters:
max
- the max- Returns:
- this
- Since:
- 3.5
-
getMin
Deprecated.Returns the minimum inclusive lower bound for a specific index. By default there is no min bound.- Returns:
- the min
- Since:
- 3.5
-
min
Deprecated.Sets the minimum inclusive lower bound for a specific index. A null value means no max is set.- Parameters:
min
- the min- Returns:
- this
- Since:
- 3.5
-
getMaxScan
Deprecated.Deprecated as of MongoDB 4.0 releaseReturns the maximum number of documents or index keys to scan when executing the query. A zero value or less will be ignored, and indicates that the driver should respect the server's default value.- Returns:
- the maxScan
- Since:
- 3.5
-
maxScan
Deprecated.Deprecated as of MongoDB 4.0 releaseSets the maximum number of documents or index keys to scan when executing the query. A zero value or less will be ignored, and indicates that the driver should respect the server's default value.- Parameters:
maxScan
- the maxScan- Returns:
- this
- Since:
- 3.5
-
isReturnKey
public boolean isReturnKey()Deprecated.Returns the returnKey. If true the find operation will return only the index keys in the resulting documents. Default value is false. If returnKey is true and the find command does not use an index, the returned documents will be empty.- Returns:
- the returnKey
- Since:
- 3.5
-
returnKey
Deprecated.Sets the returnKey. If true the find operation will return only the index keys in the resulting documents.- Parameters:
returnKey
- the returnKey- Returns:
- this
- Since:
- 3.5
-
isShowRecordId
public boolean isShowRecordId()Deprecated.Returns the showRecordId. Determines whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents. The default is false.- Returns:
- the showRecordId
- Since:
- 3.5
-
showRecordId
Deprecated.Sets the showRecordId. Set to true to add a field$recordId
to the returned documents.- Parameters:
showRecordId
- the showRecordId- Returns:
- this
- Since:
- 3.5
-
isSnapshot
Deprecated.Deprecated in MongoDB 3.6 release and removed in MongoDB 4.0 releaseReturns the snapshot. Prevents the cursor from returning a document more than once because of an intervening write operation. The default is false.- Returns:
- the snapshot
- Since:
- 3.5
-
snapshot
Deprecated.Deprecated in MongoDB 3.6 release and removed in MongoDB 4.0 releaseSets the snapshot. If true it prevents the cursor from returning a document more than once because of an intervening write operation.- Parameters:
snapshot
- the snapshot- Returns:
- this
- Since:
- 3.5
-
toString
Deprecated.
-