[SERVER-18208] Allow Queries to find ARRAY sizes Created: 25/Apr/15 Updated: 16/May/15 Resolved: 15/May/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Yair Lenga | Assignee: | Ramon Fernandez Marina |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Please As an alternative (or in addition), the actual size of the array should be returned. Motivation: The above change will allow the application to locate all the arrays in a specific document, and form queries for the required amount of data (using array slices) from each array. |
| Comments |
| Comment by Yair Lenga [ 16/May/15 ] |
|
Posted comment to reconsider on Regards, |
| Comment by Ramon Fernandez Marina [ 15/May/15 ] |
|
yair.lenga@gmail.com, this ticket also looks like a subset of the functionality requested in Regards, |
| Comment by Yair Lenga [ 25/Apr/15 ] |
|
For the application to use the '$size', it need to know the location and the name of of the attribute where the array is stored. In the case that the database is extended on a regular basis, taking advantage of the MongoDB ability to extend the document dynamically, the reading application does not know where the large arrays are located. Having the ability to find out where the arrays are located, and their sizes, using the above feature, will make it possible for the application to identify the arrays and their sizes, and decide on which subset of arrays/indices to retrieve. |
| Comment by Ramon Fernandez Marina [ 25/Apr/15 ] |
|
yair.lenga@gmail.com, you can already get the size of an array using a simple, one-stage aggregation pipeline – please take a look at the $size operator for a description and a short example. Can you please try this out and see if it meets your needs? Thanks, |