[SERVER-25485] explain shows incorrect parsed syntax for $elemMatch filter Created: 08/Aug/16  Updated: 11/Aug/16  Resolved: 11/Aug/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.2.8
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Asya Kamsky Assignee: David Storch
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-22833 MatchExpression::toBSON does not nece... Closed
Operating System: ALL
Participants:

 Description   

(3.2.8) > db.survey.explain().find( { item: { $elemMatch: { $gte: 3, $lte: 6 } } } )
{
	"queryPlanner" : {
		"plannerVersion" : 1,
		"namespace" : "test.survey",
		"indexFilterSet" : false,
		"parsedQuery" : {
			"item" : {
				"$elemMatch" : {
					"" : {
						"$lte" : 6
					}
				}
			}
		},
		"winningPlan" : {
			"stage" : "FETCH",
			"filter" : {
				"item" : {
					"$elemMatch" : {
						"" : {
							"$lte" : 6
						}
					}
				}
			},
...



 Comments   
Comment by David Storch [ 11/Aug/16 ]

Resolving this as a duplicate of SERVER-22833. This issue, among other issues with the parsedQuery reported in explain, were fixed in https://github.com/mongodb/mongo/commit/488f48f2f497a4e844aa3057e49f96d2a4be1bcb. These changes are currently not planned for backport to the 3.2 branch.

Comment by Asya Kamsky [ 08/Aug/16 ]

This is not an issue in 3.3.x

Comment by Asya Kamsky [ 08/Aug/16 ]

Index bounds and results are correct, it's just the displayed filter and parsedQuery that are incorrect.

Generated at Thu Feb 08 04:09:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.