I have a RethinkDB table with records structured like this:
{
one: [
{
field: val,
foo: bar
},
{
field: val2
}
]
}
Now, if I do something like
reql = reql.filter(function(tb) {
return tb("one").contains(function(k) {
return k("field").eq(val);
});
});
I match all documents where one of the objects in the array on the key "one" has a key "field" with a value matching "val". However, what I want to do is to only match the documents where all of the objects in the array on the key "one" have keys "field" with values matching "val".
How can I do this?