google-cloud-datastore

Need Help Creating GAE Datastore Loader Class?

99封情书 提交于 2019-12-11 07:22:25
问题 Need Help Creating GAE Datastore Loader Class for uploading data using appcfg.py? Any other way to simplified this process? is there any detailed example better than here When try using bulkloader.yaml: Uploading data records. [INFO ] Logging to bulkloader-log-20100701.041515 [INFO ] Throttling transfers: [INFO ] Bandwidth: 250000 bytes/second [INFO ] HTTP connections: 8/second [INFO ] Entities inserted/fetched/modified: 20/second [INFO ] Batch Size: 10 [INFO ] Opening database: bulkloader

Using post_import_function in App Engine bulkuploader yaml

我是研究僧i 提交于 2019-12-11 07:08:21
问题 I'm trying to upload some data to my App Engine datastore using the bulkuploader. For one of my entity types, I have one property that is calculated from another, so I'd really like to do some post-processing on each entity as it's imported to do this calculation. I keep seeing brief mentions of the post_import_function transform tag, but no real comprehensive documentation or examples. For now, I'm just trying to do a simple test just to get my post_import_function to work. My entity model:

Increasing Google Cloud DataStore Composite index limit

微笑、不失礼 提交于 2019-12-11 06:40:05
问题 I am using google app engine for my backend and datastore as the DB. The link https://cloud.google.com/datastore/docs/concepts/limits indicates that the maximum number of composite indexes for a project cannot be more than 200. I have around 130 composite indexes in my project and would hit the limit sometime in the future. Limit of 200 seems very less to me. Let's say I have 5 modules in my project and each module has 10 "kinds" each. In each of the kinds, I have 4 properties I want to index

How to best design a date/geographic proximity query on GAE?

孤者浪人 提交于 2019-12-11 06:38:40
问题 I'm building a directory for finding athletic tournaments on GAE with web2py and a Flex front end. The user selects a location, a radius, and a maximum date from a set of choices. I have a basic version of this query implemented, but it's inefficient and slow. One way I know I can improve it is by condensing the many individual queries I'm using to assemble the objects into bulk queries. I just learned that was possible. But I'm also thinking about a more extensive redesign that utilizes

Using Google Cloud Client Library and Google App Engine SDK Together

青春壹個敷衍的年華 提交于 2019-12-11 06:35:37
问题 I am trying to use the Google Cloud Client Library on Google App Engine. However, the Cloud Client Library and the App Engine SDK use google as an import name, and there are naming conflicts. How do I get them to work together? When I try importing a Google Cloud Client Library module, I get the following error: >> import google.cloud.datastore Traceback (most recent call last): File "<console>", line 1, in <module> File "C:\[...]\libs\google\cloud\datastore\__init__.py", line 52, in <module>

Allocating datastore id using PRNG

陌路散爱 提交于 2019-12-11 06:34:23
问题 Google Cloud Datastore documents that if an entity id needs to be pre-allocated, then one should use the allocateIds method: https://cloud.google.com/datastore/docs/best-practices#keys That method seems to make a REST or RPC call which has latency. I'd like to avoid that latency by using a PRNG in my Kubernetes Engine application. Here's the scala code: import java.security.SecureRandom class RandomFactory { protected val r = new SecureRandom def randomLong: Long = r.nextLong def randomLong

Remote API, Objectify and the DevServer don't like transactions?

眉间皱痕 提交于 2019-12-11 06:26:07
问题 I am using objectify 4 to write to the HRD datastore. Everything works fine in unit tests and running the application in devserver or production. But when I try connect using the REMOTE API to the devserver datastore, an error is thrown when the code starts a XG transaction. While connecting with the Remote API, it seems to think that HRD is not enabled. This is how I connect ... public static void main(String[] args) { RemoteApiOptions options = new RemoteApiOptions().server("localhost",

How to append structured property to list, google app engine : datestore

馋奶兔 提交于 2019-12-11 06:12:31
问题 I have to classes comment and report: class comment(ndb.Model): date =ndb.StringProperty() title=ndb.StringProperty() name=ndb.StringProperty() content=ndb.TextProperty() class report(ndb.Model): comments=ndb.StructuredProperty(comment,repeated=True) date=ndb.StringProperty() title=ndb.StringProperty() content=ndb.BlobKeyProperty() images=ndb.BlobKeyProperty(repeated=True) images_urls=ndb.StringProperty(repeated=True) so i declare comments (in the report class) as ndb.StructuredProperty ,then

Create a good looking url for a key with ancestors

放肆的年华 提交于 2019-12-11 05:46:54
问题 I need to get an instance from a key from ndb. The key may have a parent key, but I don't want to pass any parent keys to the url, because I want a nice looking url. I don't want to pass the entire key string to the url either. Is this possible? 回答1: It's possible. But parent key will be static in your code. When you get numeric id, you just reconstruct key. id = long(inputId) key = ndb.Key('Somekind', 'somevalue', 'kindOfInstance', id) instance = key.get() # get instance 'Somekind' is name

Datastore Queries to retrive multiple values in GCP Nodejs

两盒软妹~` 提交于 2019-12-11 05:46:34
问题 How to retrieve multiple values in single field in datastore nodejs. code: const query = datastore.createQuery('Task') .filter('user_id', '=', [1,2,3]) .order('priority', { descending: true }); this is not working. I need query something like this select userName from Table where user_id in (1, 2, 3); 回答1: You can query to retrieve multiple values like the following: If you have array of multiple datastore Id's like following: [1,2,3,4] You can query with gstore-node Package var userData =