Re: [google-appengine] checking if datastore key exists for one small operation only

2014-03-16 Thread Vinny P
I don't think you can do that for the price of a small operation.

An alternative would be to insert the ID of an entity into memcache
whenever it's accessed for other reasons, then check memcache first
whenever you want to do the existence check.

-
-Vinny P
Technology  Media Advisor
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com




On Thu, Mar 13, 2014 at 9:41 AM, James Gilliam jimgill...@gmail.com wrote:

 i thought there was a way to see if a database key exists for the price of
 one small operation?

 doing keyobj = Key.from_path, followed by filter( '__key__ =', keyobj ),
 followed by query.get() using key only query, you are charged one large and
 one small operation and only get the key returned.

 using, get_by_key_name you are charged one large operation, receives the
 entire entity, and it takes longer than the previous.

 i have concluded there is no way to check if a key exists for the price of
 a small operation.

 does anybody know if there is a way to check whether a key exists for just
 one small operation?

 thank you

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-appengine+unsubscr...@googlegroups.com.
 To post to this group, send email to google-appengine@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-appengine.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] checking if datastore key exists for one small operation only

2014-03-13 Thread James Gilliam
i thought there was a way to see if a database key exists for the price of 
one small operation?

doing keyobj = Key.from_path, followed by filter( '__key__ =', keyobj ), 
followed by query.get() using key only query, you are charged one large and 
one small operation and only get the key returned.

using, get_by_key_name you are charged one large operation, receives the 
entire entity, and it takes longer than the previous.

i have concluded there is no way to check if a key exists for the price of 
a small operation.

does anybody know if there is a way to check whether a key exists for just 
one small operation?

thank you

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.