danielmewes / php-rql

A PHP client driver for the RethinkDB query language (ReQL).
http://php-rql.dnsalias.net/
339 stars 60 forks source link

Question for filter/search on nested properties #149

Open kojilab opened 7 years ago

kojilab commented 7 years ago

Hi,

I'm trying to do a search/filter on nested properties using the library but can't figure it out. Any good example for something like this where I want to search for "Joe". Thanks!!!

[ 
'id' => 123,
'customer' => [
  'name' => Joe
]
]
jarodium commented 7 years ago

+1

sherl0k commented 7 years ago

I too, have been trying, and failing to find a function that pulls it off. You can do something like this, but you're stuck with only a subset of the data since your filter is limited to the lowest point in the tree.

$cursor = r\table("mytable")->getField('customer')->filter(array('name' => 'joe'))->run($conn);

@danielmewes I've asked for help on this in the rethinkdb php slack channel as well. Is this even possible with the library?