[SERVER-2293] Distinct can't process more than one key Created: 28/Dec/10 Updated: 06/Dec/22 Resolved: 09/Mar/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 1.6.5 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | xuqing | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Done | Votes: | 10 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OS:Win7 Enterprise x64 |
||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Participants: | |||||||||
| Description |
|
I have a request to distinct some data with more keys.But in mongo client or program,It can only distinct one key.I have to hand my data in C# with linq.Does this be support in the feature? |
| Comments |
| Comment by Asya Kamsky [ 09/Mar/18 ] | |
|
This can be done using aggregation framework. Something similar to:
| |
| Comment by Artur Rodrigues [ 03/Oct/12 ] | |
|
Is this available within the Aggregation Framework. The link provided bu Chris is dead. | |
| Comment by Chris Westin [ 31/May/11 ] | |
|
Until this is done directly, you can achieve this effect using group by following the instructions here: http://groups.google.com/group/fametest/browse_thread/thread/5f571f39ee79b75f/8781be252dfa8f39#8781be252dfa8f39 . | |
| Comment by Eliot Horowitz (Inactive) [ 28/Dec/10 ] | |
|
Yes - we should do this. | |
| Comment by xuqing [ 28/Dec/10 ] | |
|
for example: ); and sometimes I need to distinct some data with filter.the sql like below: but at this moment,mongo's distinct can only work as: | |
| Comment by Eliot Horowitz (Inactive) [ 28/Dec/10 ] | |
|
Do you mean distinct tuples? |