[SERVER-7884] The length of arrays should be exposed as a querieable and selectable attribute Created: 08/Dec/12 Updated: 15/Feb/13 Resolved: 09/Dec/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Yuri Finkelstein | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Today the length of the arrays in mongodb documents is not exposed for querying or retrieving. There are many situation where one needs to add to array only if its length is less than N or is a specific size. In the absence of this feature not only one needs to fetch the list first and make a decision on the client, it's impossible to do it atomically. I believe it's a natural attribute to expose and it's fairly easy to. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 09/Dec/12 ] |
|
You can query on the size of the array, (using $size) |