[SERVER-11347] Dot notation in Projections not working Created: 24/Oct/13 Updated: 10/Dec/14 Resolved: 29/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.4.7 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Edgardo Vega | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | query | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
CentOS 6.4 |
||
| Issue Links: |
|
||||||||||||||||
| Operating System: | Linux | ||||||||||||||||
| Steps To Reproduce: | I have the following documents /* 0 */ , } /* 1 */ , } /* 2 */ , } If I run ) I get back all the documents without the ID as expected /* 0 */ } /* 1 */ } /* 2 */ } If I do db['dbname'].find({}, { _id: 0, "Updated Time" : 1, "geoPoint1.coordinates.0" :1}) I get the following /* 0 */ } /* 1 */ } /* 2 */ } /* 3 */ } |
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Using dot notation in projections does not work as expected. |
| Comments |
| Comment by J Rassi [ 29/Oct/13 ] | |||||
|
The array notation syntax you are using in your projection – {"geoPoint1.coordinates.0": 1} – is not supported for reaching inside of arrays. You need to use projection operators to project values from arrays. See the following example of the $slice projection operator:
Filed |