-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Export to Language
-
None
-
Environment:OS: Windows
MongoDB.Driver: Version=2.25.0
-
Developer Tools
Problem Statement/Rationale
What is going wrong? What action would you like the Engineering team to take?
When creating an aggregation pipeline and having multiple text steps in the must and should collectors such as
compound: {
must: [
{
text: {
query: "query",
path: "path",
}
},
text: {
query: "query",
path: "path",
}
}]},
should: [
{
text: {
query: "query",
path: "path",
},
text: {
query: "query",
path: "path",
}
]}
Please be sure to attach relevant logs with any sensitive data redacted.
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Duplicate element name 'text'.
at MongoDB.Bson.BsonDocument.Add(BsonElement element)
at MongoDB.Bson.BsonDocument.Add(String name, BsonValue value)
Steps to Reproduce
In Compass, create a search aggregation pipeline with multiple text operators for the must, filter and should collectors. Export it then to the C# language and try to run it, you should see the above exception
Expected Results
Expect the export language feature to work out of the box in C# like it does in Compass
Actual Results
Exception in console
Additional Notes
Any additional information that may be useful to include.