In fact it seems that negating the contains always return zero rows regardless of the predicate. I'm obviously not understanding how the elixir code is getting transformed into the REQL expression.
How would I go about returning documents where the contacts property does not contain an item with a certain property.
I see in the RethinkDB examples they use a not() clause. I have browsed query.ex and cannot see any similar function to transform the contains to its negation.
Hi there, sorry to open an issue but not sure where to ask.
I want to select documents where an array property does not contain a value.
table("users") |> filter(lambda fn(user) -> contains(user["contacts"], lambda fn(contact) -> contact["id"] == contact_id end ) end) |> Database.run
The above code correctly return documents where the contacts property does contain an item whose id property is a certain value (contact_id).
If I naively negate the contains as !contains, I get zero results which is not correct:
table("users") |> filter(lambda fn(user) -> !contains(user["contacts"], lambda fn(contact) -> contact["id"] == contact_id end ) end) |> Database.run
In fact it seems that negating the contains always return zero rows regardless of the predicate. I'm obviously not understanding how the elixir code is getting transformed into the REQL expression.
How would I go about returning documents where the contacts property does not contain an item with a certain property.
I see in the RethinkDB examples they use a not() clause. I have browsed query.ex and cannot see any similar function to transform the contains to its negation.
Any help would be appreciated, thank you.