IChannelQueryAsyncTDocument Method (CollectionNamespace, BsonDocument, BsonDocument, IElementNameValidator, Int32, Int32, Boolean, Boolean, Boolean, Boolean, Boolean, IBsonSerializerTDocument, MessageEncoderSettings, CancellationToken) |
Executes a Query protocol.
Namespace:
MongoDB.Driver.Core.Bindings
Assembly:
MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.22.0+75246110ed1247226fcc7f8eb2c54ffab745693e
Syntax Task<CursorBatch<TDocument>> QueryAsync<TDocument>(
CollectionNamespace collectionNamespace,
BsonDocument query,
BsonDocument fields,
IElementNameValidator queryValidator,
int skip,
int batchSize,
bool secondaryOk,
bool partialOk,
bool noCursorTimeout,
bool tailableCursor,
bool awaitData,
IBsonSerializer<TDocument> serializer,
MessageEncoderSettings messageEncoderSettings,
CancellationToken cancellationToken
)
Function QueryAsync(Of TDocument) (
collectionNamespace As CollectionNamespace,
query As BsonDocument,
fields As BsonDocument,
queryValidator As IElementNameValidator,
skip As Integer,
batchSize As Integer,
secondaryOk As Boolean,
partialOk As Boolean,
noCursorTimeout As Boolean,
tailableCursor As Boolean,
awaitData As Boolean,
serializer As IBsonSerializer(Of TDocument),
messageEncoderSettings As MessageEncoderSettings,
cancellationToken As CancellationToken
) As Task(Of CursorBatch(Of TDocument))
abstract QueryAsync :
collectionNamespace : CollectionNamespace *
query : BsonDocument *
fields : BsonDocument *
queryValidator : IElementNameValidator *
skip : int *
batchSize : int *
secondaryOk : bool *
partialOk : bool *
noCursorTimeout : bool *
tailableCursor : bool *
awaitData : bool *
serializer : IBsonSerializer<'TDocument> *
messageEncoderSettings : MessageEncoderSettings *
cancellationToken : CancellationToken -> Task<CursorBatch<'TDocument>>
Parameters
- collectionNamespace
- Type: MongoDB.DriverCollectionNamespace
The collection namespace. - query
- Type: MongoDB.BsonBsonDocument
The query. - fields
- Type: MongoDB.BsonBsonDocument
The fields. - queryValidator
- Type: MongoDB.Bson.IOIElementNameValidator
The query validator. - skip
- Type: SystemInt32
The number of documents to skip. - batchSize
- Type: SystemInt32
The size of a batch. - secondaryOk
- Type: SystemBoolean
if set to true sets the SecondaryOk bit to true in the query message sent to the server. - partialOk
- Type: SystemBoolean
if set to true the server is allowed to return partial results if any shards are unavailable. - noCursorTimeout
- Type: SystemBoolean
if set to true the server will not timeout the cursor. - tailableCursor
- Type: SystemBoolean
if set to true the query should return a tailable cursor. - awaitData
- Type: SystemBoolean
if set to true the server should await awhile before returning an empty batch for a tailable cursor. - serializer
- Type: MongoDB.Bson.SerializationIBsonSerializerTDocument
The serializer. - messageEncoderSettings
- Type: MongoDB.Driver.Core.WireProtocol.Messages.EncodersMessageEncoderSettings
The message encoder settings. - cancellationToken
- Type: System.ThreadingCancellationToken
The cancellation token.
Type Parameters
- TDocument
- The type of the document.
Return Value
Type:
TaskCursorBatchTDocumentA Task whose result is the result of the Insert protocol.
See Also