-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.0.6, 2.6.3
-
Component/s: Querying
-
Minor Change
-
ALL
-
Query 2019-11-04, Query 2019-11-18, Query 2019-12-02
Observed behavior: In the query projection implementation, the projection
{ a:1, 'a.b':1 }is equivalent to
{ 'a.b':1 }not
{ a:1 } (at least in some cases).
Expected behavior: The projection
is equivalent to
{ a:1 }.
Test:
> c.save( { a:[ 1, { b:2 }, { c:3 } ] } ) > c.find( {}, { a:1 } ) { "_id" : ObjectId("50085e465d040dc2ab6a269a"), "a" : [ 1, { "b" : 2 }, { "c" : 3 } ] } > c.find( {}, { 'a.b':1 } ) { "_id" : ObjectId("50085e465d040dc2ab6a269a"), "a" : [ { "b" : 2 }, { } ] } > c.find( {}, { a:1, 'a.b':1 } ) { "_id" : ObjectId("50085e465d040dc2ab6a269a"), "a" : [ { "b" : 2 }, { } ] }
- is duplicated by
-
SERVER-6434 Query projection behavior shouldn't depend on order of fields
- Closed
-
SERVER-39963 order of find projection with field and dotted field changes results
- Closed
-
SERVER-23286 Document field is empty when a subkey is after the parent key in projection
- Closed
-
SERVER-46670 Document the behavior when projection includes fields "a" and "a.b"
- Closed