[SERVER-1797] I need to be able to filter a document down to a single item in a list of items Created: 15/Sep/10 Updated: 30/Aug/17 Resolved: 16/Sep/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 1.6.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ryan Cole | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 10.04, 64-bit |
||
| Participants: |
| Description |
|
Consider the following document: db.session.save({'id': 1, 'items': [ {'id': 1, 'name': 'foo'}, {'id': 2, 'name': 'bar'}, {'id': 3, 'name': 'baz'}]}) I'd like to be able to filter down to only the single {'id': 1, 'name': 'foo'}item in the 'items' list. This seems to not be possible. I can only seem to filter down to the entire 'items' list, and then in code (Python) I have to reduce the resulting list down to the 1 item I'm looking for. This just seems like something that should be easily done by the database. Bringing this up in the IRC channel resulted in 2 other people stating that they were actively working around the same problem. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 16/Sep/10 ] |
|
This |