T
- the operations result type.@Deprecated public class FindOperation<T> extends java.lang.Object implements AsyncReadOperation<AsyncBatchCursor<T>>, ReadOperation<BatchCursor<T>>
Constructor and Description |
---|
FindOperation(MongoNamespace namespace,
Decoder<T> decoder)
Deprecated.
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
ReadOperation<BsonDocument> |
asExplainableOperation(ExplainVerbosity explainVerbosity)
Deprecated.
Gets an operation whose execution explains this operation.
|
AsyncReadOperation<BsonDocument> |
asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
Deprecated.
Gets an operation whose execution explains this operation.
|
FindOperation<T> |
batchSize(int batchSize)
Deprecated.
Sets the number of documents to return per batch.
|
FindOperation<T> |
collation(Collation collation)
Deprecated.
Sets the collation options
|
FindOperation<T> |
comment(java.lang.String comment)
Deprecated.
Sets the comment to the query.
|
FindOperation<T> |
cursorType(CursorType cursorType)
Deprecated.
Sets the cursor type.
|
BatchCursor<T> |
execute(ReadBinding binding)
Deprecated.
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback)
Deprecated.
General execute which can return anything of type T
|
FindOperation<T> |
filter(BsonDocument filter)
Deprecated.
Sets the query filter to apply to the query.
|
int |
getBatchSize()
Deprecated.
Gets the number of documents to return per batch.
|
Collation |
getCollation()
Deprecated.
Returns the collation options
|
java.lang.String |
getComment()
Deprecated.
Returns the comment to send with the query.
|
CursorType |
getCursorType()
Deprecated.
Get the cursor type.
|
Decoder<T> |
getDecoder()
Deprecated.
Gets the decoder used to decode the result documents.
|
BsonDocument |
getFilter()
Deprecated.
Gets the query filter.
|
BsonValue |
getHint()
Deprecated.
Returns the hint for which index to use.
|
int |
getLimit()
Deprecated.
Gets the limit to apply.
|
BsonDocument |
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 |
getMaxScan()
Deprecated.
Deprecated as of MongoDB 4.0 release
|
long |
getMaxTime(java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Gets the maximum execution time on the server for this operation.
|
BsonDocument |
getMin()
Deprecated.
Returns the minimum inclusive lower bound for a specific index.
|
BsonDocument |
getModifiers()
Deprecated.
Gets the query modifiers to apply to this operation.
|
MongoNamespace |
getNamespace()
Deprecated.
Gets the namespace.
|
BsonDocument |
getProjection()
Deprecated.
Gets a document describing the fields to return for all matching documents.
|
boolean |
getRetryReads()
Deprecated.
Gets the value for retryable reads.
|
int |
getSkip()
Deprecated.
Gets the number of documents to skip.
|
BsonDocument |
getSort()
Deprecated.
Gets the sort criteria to apply to the query.
|
FindOperation<T> |
hint(BsonValue hint)
Deprecated.
Sets the hint for which index to use.
|
boolean |
isNoCursorTimeout()
Deprecated.
Returns true if cursor timeout has been turned off.
|
boolean |
isOplogReplay()
Deprecated.
Internal replication use only.
|
boolean |
isPartial()
Deprecated.
Returns true if can get partial results from a mongos if some shards are down.
|
boolean |
isReturnKey()
Deprecated.
Returns the returnKey.
|
boolean |
isShowRecordId()
Deprecated.
Returns the showRecordId.
|
boolean |
isSlaveOk()
Deprecated.
Returns true if set to allowed to query non-primary replica set members.
|
boolean |
isSnapshot()
Deprecated.
Deprecated in MongoDB 3.6 release and removed in MongoDB 4.0 release
|
FindOperation<T> |
limit(int limit)
Deprecated.
Sets the limit to apply.
|
FindOperation<T> |
max(BsonDocument max)
Deprecated.
Sets the exclusive upper bound for a specific index.
|
FindOperation<T> |
maxAwaitTime(long maxAwaitTime,
java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Sets the maximum await execution time on the server for this operation.
|
FindOperation<T> |
maxScan(long maxScan)
Deprecated.
Deprecated as of MongoDB 4.0 release
|
FindOperation<T> |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Sets the maximum execution time on the server for this operation.
|
FindOperation<T> |
min(BsonDocument min)
Deprecated.
Sets the minimum inclusive lower bound for a specific index.
|
FindOperation<T> |
modifiers(BsonDocument modifiers)
Deprecated.
use the individual setters instead
|
FindOperation<T> |
noCursorTimeout(boolean noCursorTimeout)
Deprecated.
Sets if the cursor timeout should be turned off.
|
FindOperation<T> |
oplogReplay(boolean oplogReplay)
Deprecated.
Internal replication use only.
|
FindOperation<T> |
partial(boolean partial)
Deprecated.
Sets if partial results from a mongos if some shards are down are allowed
|
FindOperation<T> |
projection(BsonDocument projection)
Deprecated.
Sets a document describing the fields to return for all matching documents.
|
FindOperation<T> |
retryReads(boolean retryReads)
Deprecated.
Enables retryable reads if a read fails due to a network error.
|
FindOperation<T> |
returnKey(boolean returnKey)
Deprecated.
Sets the returnKey.
|
FindOperation<T> |
showRecordId(boolean showRecordId)
Deprecated.
Sets the showRecordId.
|
FindOperation<T> |
skip(int skip)
Deprecated.
Sets the number of documents to skip.
|
FindOperation<T> |
slaveOk(boolean slaveOk)
Deprecated.
Sets if allowed to query non-primary replica set members.
|
FindOperation<T> |
snapshot(boolean snapshot)
Deprecated.
Deprecated in MongoDB 3.6 release and removed in MongoDB 4.0 release
|
FindOperation<T> |
sort(BsonDocument sort)
Deprecated.
Sets the sort criteria to apply to the query.
|
public FindOperation(MongoNamespace namespace, Decoder<T> decoder)
namespace
- the database and collection namespace for the operation.decoder
- the decoder for the result documents.public MongoNamespace getNamespace()
public Decoder<T> getDecoder()
public BsonDocument getFilter()
public FindOperation<T> filter(BsonDocument filter)
filter
- the filter, which may be null.public int getBatchSize()
public FindOperation<T> batchSize(int batchSize)
batchSize
- the batch sizepublic int getLimit()
public FindOperation<T> limit(int limit)
limit
- the limit, which may be nullpublic BsonDocument getModifiers()
@Deprecated public FindOperation<T> modifiers(BsonDocument modifiers)
modifiers
- the query modifiers to apply, which may be null.public BsonDocument getProjection()
public FindOperation<T> projection(BsonDocument projection)
projection
- the project document, which may be null.public long getMaxTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic FindOperation<T> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
maxTime
- the max timetimeUnit
- the time unit, which may not be nullpublic long getMaxAwaitTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic FindOperation<T> maxAwaitTime(long maxAwaitTime, java.util.concurrent.TimeUnit timeUnit)
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 nullpublic int getSkip()
public FindOperation<T> skip(int skip)
skip
- the number of documents to skippublic BsonDocument getSort()
public FindOperation<T> sort(BsonDocument sort)
sort
- the sort criteria, which may be null.public CursorType getCursorType()
public FindOperation<T> cursorType(CursorType cursorType)
cursorType
- the cursor typepublic boolean isSlaveOk()
public FindOperation<T> slaveOk(boolean slaveOk)
slaveOk
- true if allowed to query non-primary replica set members.public boolean isOplogReplay()
public FindOperation<T> oplogReplay(boolean oplogReplay)
oplogReplay
- the oplogReplay valuepublic boolean isNoCursorTimeout()
The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use.
public FindOperation<T> noCursorTimeout(boolean noCursorTimeout)
noCursorTimeout
- true if the cursor timeout should be turned off.public boolean isPartial()
public FindOperation<T> partial(boolean partial)
partial
- allow partial results from a mongos if some shards are downpublic Collation getCollation()
public FindOperation<T> collation(Collation collation)
A null value represents the server default.
collation
- the collation options to usepublic java.lang.String getComment()
public FindOperation<T> comment(java.lang.String comment)
comment
- the commentpublic BsonValue getHint()
public FindOperation<T> hint(BsonValue hint)
hint
- the hintpublic BsonDocument getMax()
public FindOperation<T> max(BsonDocument max)
max
- the maxpublic BsonDocument getMin()
public FindOperation<T> min(BsonDocument min)
min
- the min@Deprecated public long getMaxScan()
@Deprecated public FindOperation<T> maxScan(long maxScan)
maxScan
- the maxScanpublic boolean isReturnKey()
public FindOperation<T> returnKey(boolean returnKey)
returnKey
- the returnKeypublic boolean isShowRecordId()
public FindOperation<T> showRecordId(boolean showRecordId)
$recordId
to the returned documents.showRecordId
- the showRecordId@Deprecated public boolean isSnapshot()
@Deprecated public FindOperation<T> snapshot(boolean snapshot)
snapshot
- the snapshotpublic FindOperation<T> retryReads(boolean retryReads)
retryReads
- true if reads should be retriedpublic boolean getRetryReads()
public BatchCursor<T> execute(ReadBinding binding)
ReadOperation
execute
in interface ReadOperation<BatchCursor<T>>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback)
AsyncReadOperation
executeAsync
in interface AsyncReadOperation<AsyncBatchCursor<T>>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executedpublic ReadOperation<BsonDocument> asExplainableOperation(ExplainVerbosity explainVerbosity)
explainVerbosity
- the explain verbositypublic AsyncReadOperation<BsonDocument> asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
explainVerbosity
- the explain verbosityCopyright © 2010 - 2023 Adobe. All Rights Reserved