考虑以下文档结构(用户)
id user_id phone
1 Balan {0 - id = adsfasf232332 - number = 908767778},
...........{1 - id = adsf343fadfasd - number = 22232323}
2 Kumar {0 - id = adsfasf24442 - number = 2727272}
什么是 Mongo 模型查询等价于以下查询
select * from users where user_id = "Balan" and phone_number in (22232323)
我尝试了以下查询,但没有帮助
temp = User.where(user_id: => "Balan").where('phone.number' => "22232323")
我究竟做错了什么?
注意:Phone 类嵌入在 User 类中。