How to search dictionary having dot(.) in keys name

C# model
public Dictionary<string, List>? ConditionFields { get; set; }

Mongo json

“ConditionFields”: {
“customer.first_name”: [
“test_name”,
]
}

Query
{ “ConditionFields.customer.first_name”: “test_name” }

I have used above query but its not working. if I replace dot(.) in key name with _ then it returns result. Unfortunately I cannot change key names. So, how to make mongo engine understand that “customer.first_name” is a single key.

Hi @Iftikhar_Younus

There are some serious limitations with using an field name containing a dot/period. Some information to consider is at https://www.mongodb.com/docs/manual/core/dot-dollar-considerations/.