>> Wow! You guys are great. Geode Query engine is great :)
-Anil. On Wed, Jul 15, 2015 at 5:58 PM, Real Wes Williams <[email protected]> wrote: > Wow! You guys are great. Seriously, this should be documented more clearly > since this is a powerful use. > > Thanks since I’ve been trying lots of examples. > > -Wes > > > On Jul 15, 2015, at 6:31 PM, Anilkumar Gingade <[email protected]> > wrote: > > > >>> How can I query collections within my region object? > >>> My portfolios region contains objects of Portfolio, which in turn has a > > List<Position> > > > > The query in this case is: > > select distinct pos.id from /portfolios p, p.positions pos > > > > No need to call pos.values, as "pos" is a collection. > > > > If the query mentioned is from documentation; here it is referring to > > Positions which is a Map; calling "values" on it returns the collection > of > > map values. > > > >>> Why am I getting Undefined? Does the collection need to be other than > > List ? > > UNDEFINED. A special literal that is a valid value for any data type. An > > UNDEFINED value is the result of accessing an attribute of a null-valued > > attribute. Note that if you access an attribute that has an explicit > value > > of null, then it is not undefined. For example if a query accesses the > > attribute address.city and address is null, the result is undefined. If > the > > query accesses address, then the result is not undefined, it is NULL. > > > >>> How far can I go with nested collections? If my Position contains a > > List<Holding>, can I do > > select distinct h.id from /portfolios p, p.positions.values pos, > > pos.holdings.values > > > > There is no limit with access to nested path... > > > > -Anil. > > > > > > > > > > > > > > > > On Wed, Jul 15, 2015 at 2:33 PM, Real Wes Williams < > [email protected]> > > wrote: > > > >> How can I query collections within my region object? > >> > >> My portfolios region contains objects of Portfolio, which in turn has a > >> List<Position>. > >> > >> select distinct pos.id from /portfolios p, p.positions.values pos > returns > >> UNDEFINED. > >> > >> But > >> > http://geode-docs.cfapps.io/docs/developing/querying_basics/query_basics.html > >> < > >> > http://geode-docs.cfapps.io/docs/developing/querying_basics/query_basics.html > > > >> says I can search collections. > >> > >> Question 1) Why am I getting Undefined? Does the collection need to be > >> other than List ? > >> > >> Question 2) How far can I go with nested collections? If my Position > >> contains a List<Holding>, can I do > >> select distinct h.id from /portfolios p, p.positions.values pos, > >> pos.holdings.values > >> > >> Thanks, > >> Wes > >> > >> > >> > >
