GAE IN List query using quercus php - how to?

432 views Asked by At

I'm trying to perform a GAE low-level API query on a list using Quercus (PHP).

The java example reads:

Query query = new Query("myname");

List<String> list = Arrays.asList("test", "jack", "math");

query.addFilter("id", FilterOperator.IN, list);

which I tried in PHP with

$q = new Query('myname');     

$list = array('test' ,'jack', 'math');

$q->addFilter('id','IN', $list);

however this always results in:

com.caucho.quercus.QuercusException: com.google.appengine.api.datastore.Query.addFilter: A collection of values is required.

I've also tried creating a class object, but that didn't work neither. I have no problems with normal string or integer queries, but just with lists.

It would be great if someone could show me how to use IN list selects within quercus.

Thanks

1

There are 1 answers

0
ryan On

@androidworkz is right. i'm not familiar with quercus's php/java interface, but if you can create a java Collection and pass that as the third argument to addFilter(), instead of $list, that should get past this error.