[CSHARP-1101] invalid operator '$SetIntersection' - code 15999 Created: 12/Nov/14 Updated: 05/Apr/19 Resolved: 14/Nov/14 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | API |
| Affects Version/s: | 1.9.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Mauro Micheli | Assignee: | Robert Stam |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Official MongoCSharpDriver 1.9.2 |
||
| Attachments: |
|
| Description |
|
I have a collection named ResourceTypeCategory with documents containing a list of value object named Properties. I need the intersection of the persisted array with an input array (see below)
If i run this command on mongod shell it works fine but if i use the mongodb csharp driver method "Aggregate" in "Collection" class of official mongodbcsharpdriver i get this error: "Command 'aggregate' failed: exception: invalid operator '$SetIntersection'" This is my code:
Help! |
| Comments |
| Comment by Robert Stam [ 14/Nov/14 ] | ||||||||||||||||||||||||||||||||||||
|
You're welcome. I'm glad you got it working. | ||||||||||||||||||||||||||||||||||||
| Comment by Mauro Micheli [ 14/Nov/14 ] | ||||||||||||||||||||||||||||||||||||
|
We reviewed all the solution and we found a mistake in app.config with server names. | ||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 14/Nov/14 ] | ||||||||||||||||||||||||||||||||||||
|
I tried to reproduce this, but was unable to. Since I don't know what your documents look like or have any test data matching your documents, I used the example in the documentation for $setIntersection: http://docs.mongodb.org/manual/reference/operator/aggregation/setIntersection/ I've attached the full test program (Progam.cs), but the relevant lines are:
And the output was:
I am only able to reproduce your error message when I connect to a server older than version 2.6. | ||||||||||||||||||||||||||||||||||||
| Comment by Mauro Micheli [ 12/Nov/14 ] | ||||||||||||||||||||||||||||||||||||
|
Yes , i'm sure. | ||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 12/Nov/14 ] | ||||||||||||||||||||||||||||||||||||
|
The $setIntersection aggregation operator is new in version 2.6 of the server. Are you sure that your C# program is connecting to a new enough version of the server? |