I'm needing to create more than 1 filter to run a query to cut down the number of results found.
I am trying to do these 3 queries at once using RethinkDB for php found here
The code I am running is:
$query = \r\table('payments')->filter(
\r\row('forwarded')->eq('1'),
\r\row('bad_callbacks_sent')->lt("1"),
\r\row('confirmations')->le('7')
)->run($this->conn);
I've just also tried doing the following and it doesn't work (it's just showing all where the first argument - where forwarded = 1. It's only doing the first filter:
$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);
But it doesn't seem to be doing what I ask. I need to make it get:
- Where forwarded == 1
- Where bad_callbacks_sent < 1
- Where confirmations <= 7
I found this the following code from here, which shows that you can chain them in js but I'm wondering about PHP:
r.db('items').table('tokens')
.filter(r.row('valid_to').gt(r.now()))
.filter(r.row["processed"] == False)
Any ideas?