php-rql icon indicating copy to clipboard operation
php-rql copied to clipboard

Question for filter/search on nested properties

Open kojilab opened this issue 8 years ago • 2 comments

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
]
]

kojilab avatar Dec 14 '16 22:12 kojilab

+1

jarodium avatar Mar 01 '17 19:03 jarodium

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?

sherl0k avatar Apr 18 '17 20:04 sherl0k