I am trying to do this:
r.table(table).filter(
function (doc) {
return r.expr(array)
.contains(doc("name"));
}
)
written in golang that is
rethink.Table(table).GetAllByIndex(index, value).Filter(func(row rethink.Term) interface {}{
return rethink.Expr([]string{}).Contains(row.Field("type"))
})
I am not sure but it is like rethink.Expr is ignored. That is first problem.
Second problem is next. If I have query written like this:
query := rethink.Table(table).GetAllByIndex(index, value)
and then try to do next:
if some_condition {
q.Filter(some_filter)
}
if some_other_condition {
q.Filter(some_other_filter)
}
when i print out q.String()
i got only that first part and everything else is ignored rethink.Table(table).GetAllByIndex(index, value)