标签: mongodb mongoid
假设我想得到3个符合其中一个属性的文件
课堂提问:
name=>a, topic=>b name=>c, topic=>d name=>e, topic=>f
mongoid获取这些语法的适当语法是什么?
答案 0 :(得分:1)
根据mongoid query syntax:
Model.any_of({:name => a, :topic => b}, {:name => c, :topic => d}, {:name => e, :topic => f})