我有以下JSON结构:
{
"communication": {
"office": {
"email": "test@example.com"
},
"private": {
"email": "test2@example.com"
},
}
}
Run Code Online (Sandbox Code Playgroud)
我想基于类型(例如办公室或私人)动态查询电子邮件.当我使用以下命令时:
@Query(value = "{ 'communication.?0.email' : ?1 }")
Object findByEmail(String type, String email);
Run Code Online (Sandbox Code Playgroud)
该
'communication.?0.email'
Run Code Online (Sandbox Code Playgroud)
转换为
'communication."office".email'
Run Code Online (Sandbox Code Playgroud)
和mongo没有找到一个条目.如何在办公前后避免报价?