diff options
author | Davis Haupt <davis.haupt@mongodb.com> | 2023-05-03 19:59:01 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-03 21:25:10 +0000 |
commit | 1470c88daaa805408f083a1c2f7bb22f1632b5d1 (patch) | |
tree | 205ab378fea5664b95d33a541345ef70abd2f4c5 /src/mongo/s/query | |
parent | 693d1b831df752bc37e866733229f6dcf88c6944 (diff) | |
download | mongo-1470c88daaa805408f083a1c2f7bb22f1632b5d1.tar.gz |
SERVER-76208 support query shape serialization in IDL for types with custom serializers
Diffstat (limited to 'src/mongo/s/query')
-rw-r--r-- | src/mongo/s/query/async_results_merger_params.idl | 19 | ||||
-rw-r--r-- | src/mongo/s/query/document_source_merge_cursors.cpp | 8 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/mongo/s/query/async_results_merger_params.idl b/src/mongo/s/query/async_results_merger_params.idl index 42074b7b62e..2145840972f 100644 --- a/src/mongo/s/query/async_results_merger_params.idl +++ b/src/mongo/s/query/async_results_merger_params.idl @@ -51,15 +51,19 @@ types: structs: RemoteCursor: description: A description of a cursor opened on a remote server. + query_shape_component: true fields: shardId: type: string description: The shardId of the shard on which the cursor resides. + query_shape: anonymize hostAndPort: type: HostAndPort description: The exact host (within the shard) on which the cursor resides. + query_shape: anonymize cursorResponse: type: CursorResponse + query_shape: literal description: The response after establishing a cursor on the remote shard, including the first batch. @@ -67,35 +71,46 @@ structs: description: The parameters needed to establish an AsyncResultsMerger. chained_structs: OperationSessionInfoFromClient : OperationSessionInfo + query_shape_component: true fields: sort: type: object description: The sort requested on the merging operation. Empty if there is no sort. optional: true + query_shape: literal compareWholeSortKey: type: bool default: false + query_shape: literal description: >- When 'compareWholeSortKey' is true, $sortKey is a scalar value, rather than an object. We extract the sort key {$sortKey: <value>}. The sort key pattern is verified to be {$sortKey: 1}. - remotes: array<RemoteCursor> + remotes: + type: array<RemoteCursor> + query_shape: literal tailableMode: type: TailableMode optional: true description: If set, the tailability mode of this cursor. + query_shape: parameter batchSize: type: safeInt64 optional: true description: The batch size for this cursor. - nss: namespacestring + query_shape: literal + nss: + type: namespacestring + query_shape: custom allowPartialResults: type: bool default: false description: If set, error responses are ignored. + query_shape: parameter recordRemoteOpWaitTime: type: bool default: false + query_shape: parameter description: >- This parameter is not used anymore but should stay for a while for backward compatibility. diff --git a/src/mongo/s/query/document_source_merge_cursors.cpp b/src/mongo/s/query/document_source_merge_cursors.cpp index 1d49bcdf916..c707596fdc7 100644 --- a/src/mongo/s/query/document_source_merge_cursors.cpp +++ b/src/mongo/s/query/document_source_merge_cursors.cpp @@ -117,13 +117,7 @@ DocumentSource::GetNextResult DocumentSourceMergeCursors::doGetNext() { Value DocumentSourceMergeCursors::serialize(SerializationOptions opts) const { invariant(!_blockingResultsMerger); invariant(_armParams); - if (opts.applyHmacToIdentifiers || opts.replacementForLiteralArgs) { - // TODO: SERVER-76208 support query shapification for IDL types like namespacestring with - // custom serializers. - MONGO_UNIMPLEMENTED_TASSERT(7484301); - } - - return Value(Document{{kStageName, _armParams->toBSON()}}); + return Value(Document{{kStageName, _armParams->toBSON(opts)}}); } boost::intrusive_ptr<DocumentSource> DocumentSourceMergeCursors::createFromBson( |