[CSHARP-2842] The format of Aggregate Explain response has been changed Created: 05/Nov/19  Updated: 28/Oct/23  Resolved: 06/Nov/19

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.10.0

Type: Task Priority: Major - P3
Reporter: Dmitry Lukyanov (Inactive) Assignee: Dmitry Lukyanov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The format of an Aggregate Explain response has been changed.

Before we had:

{
	"stages": [{
			"$cursor": {
				"query": {},
				"fields": {
					"x": 1,
					"_id": 1
				},
				"queryPlanner": {
					"plannerVersion": 1,
					"namespace": "Tests11051524.MongoCollectionTests",
					"indexFilterSet": false,
					"parsedQuery": {},
					"queryHash": "8B3D4AB8",
					"planCacheKey": "8B3D4AB8",
					"winningPlan": {
						"stage": "COLLSCAN",
						"direction": "forward"
					},
					"rejectedPlans": []
				}
			}
		}, {
			"$project": {
				"_id": true,
				"x": "$x"
			}
		}
	],
	"ok": 1.0
}

, but now all latests servers return:

{
	"queryPlanner": {
		"plannerVersion": 1,
		"namespace": "Tests11051512.MongoCollectionTests",
		"indexFilterSet": false,
		"parsedQuery": {},
		"queryHash": "8B3D4AB8",
		"planCacheKey": "8B3D4AB8",
		"optimizedPipeline": true,
		"winningPlan": {
			"stage": "PROJECTION_DEFAULT",
			"transformBy": {
				"_id": true,
				"x": "$x"
			},
			"inputStage": {
				"stage": "COLLSCAN",
				"direction": "forward"
			}
		},
		"rejectedPlans": []
	},
	"serverInfo": {
		"host": "EPBYMINW3653",
		"port": 27017,
		"version": "4.3.0-2014-g8010c51",
		"gitVersion": "8010c51d3f1cc1020959f8b351f8242d141d42a3"
	},
	"ok": 1.0
}

can be related to this ticket: https://jira.mongodb.org/browse/SERVER-38691



 Comments   
Comment by Githook User [ 06/Nov/19 ]

Author:

{'username': 'DmitryLukyanov', 'email': 'dmitry.lukyanov@mongodb.com', 'name': 'DmitryLukyanov'}

Message: CSHARP-2842: Fix AggregateExplain test.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/a1ac09c734d312e8f6f4a2304d5fe80262f9b2e0

Comment by Robert Stam [ 05/Nov/19 ]

All we're really trying to assert in this test is that the explain command was executed.

Maybe we could just check whether the response contains stages or queryPlanner to handle all server versions.

We could also just check that the response contains { ok : 1.0 } but that would be a slightly weaker assertion.

Generated at Wed Feb 07 21:43:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.