google-cloud-datastore

One-to-many relationships in datastore

我们两清 提交于 2019-12-21 22:16:11
问题 There is a nice explanation of 1-to-many relationships in datastore here by Rafe Kaplan. I tried to adapt that to a simpler case of User and Venue . So user can go to many restaurants; and I want to print the user email and the restaurants the user went to: class User(db.Model): userEmail = db.StringProperty() class Venue(db.Model): user = db.ReferenceProperty(User, collection_name="venues") venue = db.StringProperty() class OneToMany(webapp.RequestHandler): def get(self): scott = User

Efficient way to query in a for loop in Google App Engine?

大兔子大兔子 提交于 2019-12-21 21:26:55
问题 In the GAE documentation, it states: Because each get() or put() operation invokes a separate remote procedure call (RPC), issuing many such calls inside a loop is an inefficient way to process a collection of entities or keys at once. Who knows how many other inefficiencies I have in my code, so I'd like to minimize as much as I can. Currently, I do have a for loop where each iteration has a separate query. Let's say I have a User, and a user has friends. I want to get the latest updates for

How to access cloud datastore from apps script with a service account

此生再无相见时 提交于 2019-12-21 21:23:13
问题 Trying to access a google cloud datastore from google apps script with a service account like this. I have got the sample from here I am not sure if the SCOPE is ok or if another scope is needed. Running the function run() gives errors like "Error retrieving token: invalid_scope, https://www.googleapis.com/auth/userinfo.email is not a valid audience string." // testing Cloud Datastore access via service account var PRIVATE_KEY = "-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----\n"; var

Is there a way to trigger a Google Cloud Function with a Google Datastore event?

心不动则不痛 提交于 2019-12-21 17:49:49
问题 It seems like you can get events from Google Cloud Platform, but not from Google App Engine services. Why is that? Thanks 回答1: Cloud Functions is a new service on GCP, whereas Cloud Datastore is a high query per second (QPS) service that is more sensitive to latency changes. This means it's still early and integration with Cloud Datastore is more complex than most other systems. It's been looked into, but nothing to announce yet. 回答2: Have you looked at Datastore Callbacks? They're somewhat

Google App Engine - DELETE JPQL Query and Cascading

十年热恋 提交于 2019-12-21 10:54:03
问题 I noticed that the children of PersistentUser are not deleted when using the JPQL query below. However, the children are deleted if I perform an entityManager.remove(object) . Is this expected? Why doesn't the JPQL query below also perform a cascaded delete? @OneToMany(mappedBy = "persistentUser", cascade = CascadeType.ALL) private Collection<PersistentLogin> persistentLogins; ... @Override @Transactional public final void removeUserTokens(final String username) { final Query query =

Google App Engine - DELETE JPQL Query and Cascading

此生再无相见时 提交于 2019-12-21 10:53:13
问题 I noticed that the children of PersistentUser are not deleted when using the JPQL query below. However, the children are deleted if I perform an entityManager.remove(object) . Is this expected? Why doesn't the JPQL query below also perform a cascaded delete? @OneToMany(mappedBy = "persistentUser", cascade = CascadeType.ALL) private Collection<PersistentLogin> persistentLogins; ... @Override @Transactional public final void removeUserTokens(final String username) { final Query query =

Complex Queries using GAE datastore

耗尽温柔 提交于 2019-12-21 09:17:37
问题 I am in the early stages of developing a sports statistics website (ultimate frisbee) and would like to know your opinions if Google App Engine is right for me. I am writing it in Python using Django and have been comfortable with standard RDBMS for years but this site is a long term project and I am expecting very large amounts of data so I would like the "infinite" scaling that the GAE datastore offers. A vast majority of the queries to the database will return very standard results that

How can I submit a text field in the POST request that uploads a blob to the Blobstore and retrieve it in the upload handler for the blob?

喜夏-厌秋 提交于 2019-12-21 07:56:35
问题 I have read several similar questions on StackOverflow but haven't found a solution to this problem yet. I am uploading a blob from Android to App Engine's Blobstore through an HTTPPost to the upload URL generated by the Blobstore service. I want to be able to send some textual metadata with this request that identifies this blob. I want to retrieve this information along with the blob key in the upload handler servlet that is called after the blob is uploaded. The problem is that the blob is

Appengine NDB: Putting 880 rows, exceeding datastore write ops quota. Why?

天大地大妈咪最大 提交于 2019-12-21 05:56:22
问题 I have an application which imports 880 rows into an NDB datastore, using put_async(). Whenever I run this import it exceeds the daily quota of 50,000 write ops to the datastore. I'm trying to understand why this operation is so expensive and what can be done to stay under quota. There are 13 columns like so: stringbool = ['true', 'false'] class BeerMenu(ndb.Model): name = ndb.StringProperty() brewery = ndb.StringProperty() origin = ndb.StringProperty() abv = ndb.FloatProperty() size = ndb

Video website on google application engine

僤鯓⒐⒋嵵緔 提交于 2019-12-21 05:31:25
问题 I am going to work on a video website where users/admin will be able to upload the videos and play them using some opensource javascript player. However, I want to know if it is a good idea to start this kind of project on google app engine considering its limitations to server and store the data. What are the issues which I may have to encounter on Google application engine and if there are any possible solutions for those issues. Currently, I have doubts on converting the videos while