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
-
- related to
-
CSHARP-5517 FilterDefinitionBuilder ElemMatch should validate type constraint
-
- Backlog
-