Hi Matija,
On Thu, Feb 11, 2010 at 2:46 PM, Matija <[email protected]> wrote:
> Documentation states:
> 'A query with a cursor does not always work as expected when the query
> uses an inequality filter or a sort order on a property with multiple
> values. Logic that de-duplicates the multivalued property for the
> query does not persist
> between queries, and may return a result more than once.'
>
> Can I use query cursor on query that uses EQUALITY filter on a
> property with multiple values ?
>
Yes, this will work fine, and not return unexpected duplicates.
The issue being referenced in the docs occurs because when an entity with
multiply valued properties is indexed, one index entry is inserted for each
value the property has. If you're executing a query with an inequality
filter or sort order on the multiply valued property, the same entity could
show up multiple times in the result set, for each entry in the multiply
valued property. There's internal logic that eliminates the second and
subsequent copies, but that's not encapsulated in the cursor.
> example
>
> q = GqlQuery("SELECT * FROM A WHERE B = :1", something)
>
> if not cursor_pos is None:
> q.with_cursor(cursor_pos)
>
> r = q.fetch(limit)
>
> ...
>
> where A is defined like
>
> class A(db.Model):
> B = db.ListProperty(unicode)
> C = db.StringProperty()
> D = db.BooleanProperty()
> ...
>
> I am trying something like that on my development server and it
> doesn't work.
>
Can you provide more details? What happens?
-Nick Johnson
>
> On Feb 11, 9:22 am, Matija <[email protected]> wrote:
> > Documentation states:
> > 'A cursor can only be used by the app that performed the original
> > query, and can only be used to continue the same query.'
> >
> > Does 'the app' means one application instance on one of application
> > servers, or every xxx.appspot.com application instance on any of
> > application servers ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
--
Nick Johnson, Developer Programs Engineer, App Engine
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.