[SERVER-9156] Projection by a substring match Created: 28/Mar/13 Updated: 06/Dec/22 Resolved: 23/Jun/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 2.4.1 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | BreakPhreak | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 5 |
| Labels: | expression | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
Let's start from an example: suppose that each document in a collection contains a UserAgent string as a field. Androids have something like "xxxxxx Android xxxx", iOS have something like "xxxxxxx iPad/iPhone xxxxxx". I would like to count those documents, grouped by platform (Android, iPad, iPhone). To get the platform, all I need is to count them by a substring match. For example, /Android/ vs /iPad/ vs /iPhone/ (each counted separately). Any solution with aggregation framework will make it for me. I can clarify/whirpool on any request with pleasure. |
| Comments |
| Comment by Charlie Swanson [ 23/Jun/17 ] |
|
This is now possible with $indexOf* expressions ( Please re-open if this use-case is not covered by either of those. |
| Comment by Asya Kamsky [ 03/Jan/17 ] |
|
This is already possible now with $indexOf* ( |
| Comment by Asya Kamsky [ 31/May/15 ] |
|
|