[CSHARP-2104] $project or $group does not support <document> Created: 20/Nov/17 Updated: 14/Jun/19 Resolved: 12/Feb/19 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | 2.4 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | rethabile | Assignee: | Wan Bachtiar |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | wb | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
windows 10, asp.net core |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Originally on SO. I'm trying to run aggregate with projection but i get NotSupportedException: $project or $group does not support <document>. I am running version 2.4.4 of driver with mongodb v3.4.
I thought IndexOfCP is supported. What am i doing wrong here? |
| Comments |
| Comment by Wan Bachtiar [ 12/Feb/19 ] | |||||||
Hi, As pointed out in your StackOverflow post, the issue here is caused by trying to project the whole document. You can actually project only specific fields within the document. i.e. Result = x.foo.
Based on your comment on StackOverflow post, it seems that your use case is trying to search and sort by the most relevant matching.
You may also find Text Search in Aggregation Pipeline useful. Regards, |