[SERVER-131] optimize multiple sub-object selectors Created: 07/Jul/09  Updated: 02/Aug/18  Resolved: 14/Aug/09

Status: Closed
Project: Core Server
Component/s: Usability
Affects Version/s: 0.9.6
Fix Version/s: 0.9.9

Type: Task Priority: Minor - P4
Reporter: Eliot Horowitz (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

> db.find5.find()
{"_id" : "4a4d6db199b25e6fee7649f9" , "a" : 1 , "b" : {"c" : 2 , "d" : 3 , "e" : 4}}
> db.find5.find( {} ,

{ "b.c" : 1}

)
{"_id" : "4a4d6db199b25e6fee7649f9" , "b" : {"c" : 2}}
> db.find5.find( {} ,

{ "b.c" : 1 , "b.d" : 1 }

)
{"_id" : "4a4d6db199b25e6fee7649f9" , "b" : {"c" : 2 , "d" : 3 , "e" : 4}}



 Comments   
Comment by Eliot Horowitz (Inactive) [ 10/Sep/09 ]

closed b/c resolved more than 2 week ago

Comment by Eliot Horowitz (Inactive) [ 14/Aug/09 ]

thanks mike!

Comment by Michael Stephens [ 14/Aug/09 ]

I've taken a stab at fixing it such that

> db.find5.find({},

{"b.c": 1 , "b.d": 1}

)
{"_id" : "4a4d6db199b25e6fee7649f9" , "b" : {"c" : 2 , "d" : 3 }}

see http://github.com/mikejs/mongo/commit/a5017ab566fde2e4062affb33d631bf8eea1425a

Comment by Eliot Horowitz (Inactive) [ 02/Aug/09 ]

the last one is what its doing now.

you're understanding is correct, though most of this already works, the code is just a bit lazy at the moment.

the code is in db/queryutil.cpp and is FieldMatcher: http://github.com/mongodb/mongo/blob/master/db/queryutil.h#L161

Comment by Steve Yalovitser [ 01/Aug/09 ]

shouldnt the last one be:
db.find5.find( {} ,

{ "b.c" : 1 , "b.d" : 1 }

)
{"_id" : "4a4d6db199b25e6fee7649f9" , "b" : {"c" : 2 , "d" : 3 }}

if I understand this correctly, this is a server side filtration of results, we want to be able to:
1) default get all
2) +subattr1,+subattr2, +subattr3
3) -subattr1, -subattr2, -subattr3

The above notation is a bit hard to understand, can you add more details...

Generated at Thu Feb 08 02:53:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.