-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.3
-
Component/s: Linq
-
Labels:None
-
Environment:Windows, Mac, C#, MongoDB 3.2, C# Driver 2.2.3 and earlier.
I'm trying to translate following MongoDB shell query into C# query.
db.col.find({"Details.a":{$elemMatch:{$elemMatch:{DeviceName : /.Name0./}}}});
As you can see $elemMatch is nested into another $elemMatch. This query runs perfectly in shell.
I have no clue how to translate it to C# as driver doesn't accept a filter without a name.
I'm trying following code:
Builders<BsonDocument>.Filter.ElemMatch ("Details.a", Builders<BsonDocument>.Filter.ElemMatch (Builders<BsonDocument>.Filter.Regex(Builders<BsonDocument>.Filter.Regex ("DeviceName",new BsonRegularExpression("")))));
No doubt, it didn't worked.
I'm wondering if you guys have any plan to add support to driver to accept filters without name?
- is related to
-
CSHARP-1107 Query.LT, LTE and other similar methods require a name while it should be optional
- Closed