How do I find an object whose properties foo or bar equal a query value?
问题 I searched google and looked at the docs, but I found no example of this. I have this object with embedded children: { teacher: "Balthazar", students: [ { name: 'Wilfred', sibling: 'Cordelia' }, { name: 'Mortimer', sibling: 'Arthur' }, { name: 'Cordelia', sibling: 'Wilfred' }, { name: 'Arthur' sibling: 'Mortimer' }, ] } I want to find Balthazar 's students whose name or sibling is in ['Wilfred', 'Cordelia', 'foo'] . I got it to work this way: criteria_a = balthazar.students.in(name: ['Wilfred