I have the following JSON structure:
{ "communication": { "office": { "email": " test@example.com " }, "private": { "email": " test2@example.com " }, } }
I want to dynamically request emails based on type, for example. office or private. When I use the following command:
@Query(value = "{ 'communication.?0.email' : ?1 }") Object findByEmail(String type, String email);
'communication.?0.email'
converted to
'communication."office".email'
and mongo did not find the record. How to avoid quotes before and after office?
source share