Package com.mongodb.client.model
Class DBCollectionFindOptions
- java.lang.Object
-
- com.mongodb.client.model.DBCollectionFindOptions
-
@Deprecated(since="2021-05-27") public final class DBCollectionFindOptions extends java.lang.Object
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.The options to apply to a find operation (also commonly referred to as a query).- Since:
- 3.4
-
-
Constructor Summary
Constructors Constructor Description DBCollectionFindOptions()
Deprecated.Construct a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DBCollectionFindOptions
batchSize(int batchSize)
Deprecated.Sets the number of documents to return per batch.DBCollectionFindOptions
collation(Collation collation)
Deprecated.Sets the collationDBCollectionFindOptions
comment(java.lang.String comment)
Deprecated.Sets the comment to the query.DBCollectionFindOptions
copy()
Deprecated.Copy this DBCollectionFindOptions instance into a new instance.DBCollectionFindOptions
cursorType(CursorType cursorType)
Deprecated.Sets the cursor type.int
getBatchSize()
Deprecated.Gets the number of documents to return per batch.Collation
getCollation()
Deprecated.Returns the collation optionsjava.lang.String
getComment()
Deprecated.Returns the comment to send with the query.CursorType
getCursorType()
Deprecated.Get the cursor type.DBObject
getHint()
Deprecated.Returns the hint for which index to use.int
getLimit()
Deprecated.Gets the limit to apply.DBObject
getMax()
Deprecated.Returns the exclusive upper bound for a specific index.long
getMaxAwaitTime(java.util.concurrent.TimeUnit timeUnit)
Deprecated.The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.long
getMaxTime(java.util.concurrent.TimeUnit timeUnit)
Deprecated.Gets the maximum execution time on the server for this operation.DBObject
getMin()
Deprecated.Returns the minimum inclusive lower bound for a specific index.DBObject
getModifiers()
Deprecated.use the individual setters insteadDBObject
getProjection()
Deprecated.Gets a document describing the fields to return for all matching documents.ReadConcern
getReadConcern()
Deprecated.Returns the readConcernReadPreference
getReadPreference()
Deprecated.Returns the readPreferenceint
getSkip()
Deprecated.Gets the number of documents to skip.DBObject
getSort()
Deprecated.Gets the sort criteria to apply to the query.DBCollectionFindOptions
hint(DBObject hint)
Deprecated.Sets the hint for which index to use.boolean
isNoCursorTimeout()
Deprecated.The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use.boolean
isOplogReplay()
Deprecated.Users should not set this under normal circumstances.boolean
isPartial()
Deprecated.Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).boolean
isReturnKey()
Deprecated.Returns the returnKey.boolean
isShowRecordId()
Deprecated.Returns the showRecordId.DBCollectionFindOptions
limit(int limit)
Deprecated.Sets the limit to apply.DBCollectionFindOptions
max(DBObject max)
Deprecated.Sets the exclusive upper bound for a specific index.DBCollectionFindOptions
maxAwaitTime(long maxAwaitTime, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the maximum await execution time on the server for this operation.DBCollectionFindOptions
maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the maximum execution time on the server for this operation.DBCollectionFindOptions
min(DBObject min)
Deprecated.Sets the minimum inclusive lower bound for a specific index.DBCollectionFindOptions
modifiers(DBObject modifiers)
Deprecated.use the individual setters insteadDBCollectionFindOptions
noCursorTimeout(boolean noCursorTimeout)
Deprecated.The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use.DBCollectionFindOptions
oplogReplay(boolean oplogReplay)
Deprecated.Users should not set this under normal circumstances.DBCollectionFindOptions
partial(boolean partial)
Deprecated.Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).DBCollectionFindOptions
projection(DBObject projection)
Deprecated.Sets a document describing the fields to return for all matching documents.DBCollectionFindOptions
readConcern(ReadConcern readConcern)
Deprecated.Sets the readConcernDBCollectionFindOptions
readPreference(ReadPreference readPreference)
Deprecated.Sets the readPreferenceDBCollectionFindOptions
returnKey(boolean returnKey)
Deprecated.Sets the returnKey.DBCollectionFindOptions
showRecordId(boolean showRecordId)
Deprecated.Sets the showRecordId.DBCollectionFindOptions
skip(int skip)
Deprecated.Sets the number of documents to skip.DBCollectionFindOptions
sort(DBObject sort)
Deprecated.Sets the sort criteria to apply to the query.
-
-
-
Method Detail
-
copy
public DBCollectionFindOptions copy()
Deprecated.Copy this DBCollectionFindOptions instance into a new instance.- Returns:
- the new DBCollectionFindOptions with the same settings as this instance.
-
getLimit
public int getLimit()
Deprecated.Gets the limit to apply. The default is null.- Returns:
- the limit
-
limit
public DBCollectionFindOptions limit(int 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, which may be null
-
skip
public DBCollectionFindOptions skip(int skip)
Deprecated.Sets the number of documents to skip.- Parameters:
skip
- the number of documents to skip- Returns:
- this
-
getMaxTime
public long getMaxTime(java.util.concurrent.TimeUnit timeUnit)
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
public DBCollectionFindOptions maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
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
public long getMaxAwaitTime(java.util.concurrent.TimeUnit timeUnit)
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
-
maxAwaitTime
public DBCollectionFindOptions maxAwaitTime(long maxAwaitTime, java.util.concurrent.TimeUnit timeUnit)
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
-
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, which may be null
-
batchSize
public DBCollectionFindOptions batchSize(int batchSize)
Deprecated.Sets the number of documents to return per batch.- Parameters:
batchSize
- the batch size- Returns:
- this
-
getModifiers
@Deprecated public DBObject getModifiers()
Deprecated.use the individual setters insteadGets 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 public DBCollectionFindOptions modifiers(@Nullable DBObject modifiers)
Deprecated.use the individual setters insteadSets the query modifiers to apply to this operation.- Parameters:
modifiers
- the query modifiers to apply, which may be null.- Returns:
- this
-
getProjection
@Nullable public DBObject getProjection()
Deprecated.Gets a document describing the fields to return for all matching documents.- Returns:
- the project document, which may be null
-
projection
public DBCollectionFindOptions projection(@Nullable DBObject 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
@Nullable public DBObject 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
public DBCollectionFindOptions sort(@Nullable DBObject 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
public DBCollectionFindOptions noCursorTimeout(boolean 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
public DBCollectionFindOptions oplogReplay(boolean 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
public DBCollectionFindOptions partial(boolean 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
public CursorType getCursorType()
Deprecated.Get the cursor type.- Returns:
- the cursor type
-
cursorType
public DBCollectionFindOptions cursorType(CursorType cursorType)
Deprecated.Sets the cursor type.- Parameters:
cursorType
- the cursor type- Returns:
- this
-
getReadPreference
@Nullable public ReadPreference getReadPreference()
Deprecated.Returns the readPreference- Returns:
- the readPreference
-
readPreference
public DBCollectionFindOptions readPreference(@Nullable ReadPreference readPreference)
Deprecated.Sets the readPreference- Parameters:
readPreference
- the readPreference- Returns:
- this
-
getReadConcern
@Nullable public ReadConcern getReadConcern()
Deprecated.Returns the readConcern- Returns:
- the readConcern
-
readConcern
public DBCollectionFindOptions readConcern(@Nullable ReadConcern readConcern)
Deprecated.Sets the readConcern- Parameters:
readConcern
- the readConcern- Returns:
- this
-
getCollation
@Nullable public Collation getCollation()
Deprecated.Returns the collation options- Returns:
- the collation options
-
collation
public DBCollectionFindOptions collation(@Nullable Collation collation)
Deprecated.Sets the collation- Parameters:
collation
- the collation- Returns:
- this
-
getComment
@Nullable public java.lang.String 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.9
-
comment
public DBCollectionFindOptions comment(@Nullable java.lang.String comment)
Deprecated.Sets the comment to the query. A null value means no comment is set.- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 3.9
-
getHint
@Nullable public DBObject getHint()
Deprecated.Returns the hint for which index to use. The default is not to set a hint.- Returns:
- the hint
- Since:
- 3.9
-
hint
public DBCollectionFindOptions hint(@Nullable DBObject 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.9
-
getMax
@Nullable public DBObject getMax()
Deprecated.Returns the exclusive upper bound for a specific index. By default there is no max bound.- Returns:
- the max
- Since:
- 3.9
-
max
public DBCollectionFindOptions max(@Nullable DBObject 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.9
-
getMin
@Nullable public DBObject getMin()
Deprecated.Returns the minimum inclusive lower bound for a specific index. By default there is no min bound.- Returns:
- the min
- Since:
- 3.9
-
min
public DBCollectionFindOptions min(@Nullable DBObject 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.9
-
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.9
-
returnKey
public DBCollectionFindOptions returnKey(boolean 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.9
-
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.9
-
showRecordId
public DBCollectionFindOptions showRecordId(boolean 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.9
-
-