Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Query Integration
-
Fully Compatible
-
ALL
Description
The pipeline in this test case fails if we try to run $queryStats afterwards. It gives this error:
pymongo.errors.OperationFailure: PlanExecutor error during aggregation :: caused by :: Was not able to re-parse queryStats key when reading queryStats.Status Location40602: $queue is only valid as the first stage in a pipeline Hash: 9564851472401003349 Query Shape: { cmdNs: { db: "documents", coll: "lookup_coll" }, command: "aggregate", pipeline: [ { $lookup: { from: "$cmd.aggregate", as: "names", localField: "id_name", foreignField: "xx", let: {}, pipeline: [ { $queue: [ { ?: "?" } ] }, { $project: { _id: true, ed6595d4-e41d-438b-95ca-33d56d3b5ae5: { $const: [ { ?: "?" } ] } } }, { $unwind: { path: "$ed6595d4-e41d-438b-95ca-33d56d3b5ae5" } }, { $replaceRoot: { newRoot: "$ed6595d4-e41d-438b-95ca-33d56d3b5ae5" } } ] } }, { $match: { names: { $not: { $eq: [] } } } }, { $project: { _id: false } } ] }, full error: {'ok': 0.0, 'errmsg': 'PlanExecutor error during aggregation :: caused by :: Was not able to re-parse queryStats key when reading queryStats.Status Location40602: $queue is only valid as the first stage in a pipeline Hash: 9564851472401003349 Query Shape: { cmdNs: { db: "documents", coll: "lookup_coll" }, command: "aggregate", pipeline: [ { $lookup: { from: "$cmd.aggregate", as: "names", localField: "id_name", foreignField: "xx", let: {}, pipeline: [ { $queue: [ { ?: "?" } ] }, { $project: { _id: true, ed6595d4-e41d-438b-95ca-33d56d3b5ae5: { $const: [ { ?: "?" } ] } } }, { $unwind: { path: "$ed6595d4-e41d-438b-95ca-33d56d3b5ae5" } }, { $replaceRoot: { newRoot: "$ed6595d4-e41d-438b-95ca-33d56d3b5ae5" } } ] } }, { $match: { names: { $not: { $eq: [] } } } }, { $project: { _id: false } } ] }', 'code': 7349401, 'codeName': 'Location7349401'}
|
The object in there is this:
{ cmdNs:
|
{ db: "documents", coll: "lookup_coll" }, |
command: "aggregate", |
pipeline: [
|
{ $lookup: {
|
from: "$cmd.aggregate", |
as: "names", |
localField: "id_name", |
foreignField: "xx", |
let: {},
|
pipeline: [
|
{ $queue: [ { "?": "?" } ] }, |
{ $project: { _id: true, "ed6595d4-e41d-438b-95ca-33d56d3b5ae5": { $const: [ { "?": "?" } ] } } }, |
{ $unwind: { path: "$ed6595d4-e41d-438b-95ca-33d56d3b5ae5" } }, |
{ $replaceRoot: { newRoot: "$ed6595d4-e41d-438b-95ca-33d56d3b5ae5" } } |
] } },
|
{ $match: { names: { $not: { $eq: [] } } } },
|
{ $project: { _id: false } } ] }; |
Attachments
Issue Links
- is depended on by
-
SERVER-85096 TRACKING: M3 Correctness Tickets
-
- Closed
-
- is related to
-
SERVER-76330 Use representative query shape in query stats store (aggregate command)
-
- Closed
-