I have a data schema that looks like this:
{
"datetime": "1453845345493",
"someIds": ["id2000-4", "id1000-34"]
}
Where the array someIds
can contain many different values.
Filtering based on one id using the following query works without issue and returns approximately 400 results. (I also plan to implement proper indexes, but am testing a simpler case for now.)
r.db("dbName").table("tableName")
.filter(r.row("datetime").gt(1453845340493))
.filter(function(someVal){
return someVal("someIds").contains("id2000-4");
})
.count()
But attempting to follow the last example in the 'contains' documentation where it recommends using a predicate function to simulate an 'or' statement returns nothing, when it should return a superset of the above:
r.db("dbName").table("tableName")
.filter(r.row("datetime").gt(1453845340493))
.filter(function(someVal){
return r.expr(["id2000-4", "id1000-77"]).contains(someVal("someIds"));
})
.count()
As far as I can tell I've followed the instructions on that page exactly, but it isn't working. I'm running RethinkDB v2.2.3-1, and am running this in the Data Explorer. Any suggestions?