1
Class Tweet
field :lD, as: :load_date, type:Time
field :t, as: :text, type:String
end
Tweet.where({:text=>{ $in: ["champ","looser"]},:load_date.gte=>1.month.ago}) #OR
Tweet.where({:text=>{ $all: ["champ","looser"]},:load_date.gte=>1.month.ago}) #AND
및 모두 내 경우와 같이 String 형식이 아닌 필드에 적용 할 수 있습니다. 각 요소를 반복하는 대신 where 절에서 condition을 사용할 수 있습니다.MongoDB 문자열 유형 필드 검색 일치 문자열 배열
를, 내가 질문을 잘못 해석했다고 가정합니다. 좀 더 자세하게 달성하려는 내용을 정확히 설명해 주시겠습니까? – jimoleary