You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is Issue 104 moved from a Google Code project.
Added by 2010-09-01T19:32:32.000Z by normel...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).
Original labels: Type-Enhancement, Priority-Low, Milestone-Release0.97
Original description
I propose the following patch to support "$or" queries. There are a few ways it can be used, I'll attach examples below.
Admittedly, this was a pretty quick hack. I read the entire Query library sourcecode, but this seems to work. If nothing else, maybe it will serve as a model for someone else's implementation?
== USING AN OR-BUILDER
Query<Asset> query = ds.createQuery(AssetState.class);
OrBuilder<Asset> or = query.or();
or.add().field("name").equal("asset-1");
or.add().field("name").equal("asset-2");
or.add().field("name").equal("asset-3");
== ADDING A COLLECTION OF SUBQUERIES
Query<Asset> query = ds.createQuery(AssetState.class);
List<Query<Asset>> queries = new ArrayList<Query<Asset>>();
queries.add(ds.createQuery(AssetState.class).field("name").equal("asset-1"));
queries.add(ds.createQuery(AssetState.class).field("name").equal("asset-2"));
queries.add(ds.createQuery(AssetState.class).field("name").equal("asset-3"));
query.or(queries)
The text was updated successfully, but these errors were encountered:
This is Issue 104 moved from a Google Code project.
Added by 2010-09-01T19:32:32.000Z by normel...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).
Original labels: Type-Enhancement, Priority-Low, Milestone-Release0.97
Original description
The text was updated successfully, but these errors were encountered: