Reputation: 7441
I have two filters that I need to combine.
This is my primary filter:
r.db('items').table('tokens').filter(r.row('valid_to').gt(r.now()))
and this is my secondary filter.
.filter(r.row["processed"] == False)
How do I combine these?
Upvotes: 0
Views: 639
Reputation: 63
Once you have the database set, you can use the filters to carry on your equation, such as:
$query = \r\table('payments')
->filter(\r\row('forwarded')->eq('1'))
->filter(\r\row('bad_callbacks_sent')->lt(6))
->filter(\r\row('confirmations')->le(7))
->run($this->conn);
You see I have the table set, which means I can continue doing queries for that table without re-defining that table.
Upvotes: 0
Reputation: 4614
Just chain them together!
r.db('items').table('tokens')
.filter(r.row('valid_to').gt(r.now()))
.filter(r.row["processed"] == False)
And you can keep chaining stuff after that.
Upvotes: 4