google-cloud-datastore

Nested structs on GAE datastore using Go

随声附和 提交于 2019-12-30 18:44:13
问题 I'm trying to figure out how to get nested structs to work with GAE datastore using Go. I know the datastore doesn't specifically support nested structs. I need to find a simple way of getting user information to go with a post when it is sent out to a user as JSON. One thing I thought of was to put two fields for the user. One for the ID/key referencing to user and another one for the user type struct which would be added there when the post is loaded from the datastore. Extra fields seem

How to make http call on DialogFlow v2 using Javascript ajax call

不想你离开。 提交于 2019-12-29 08:01:37
问题 I found this example on the official site of DialogFlow using Node.js and it is working fine, but I dont know how do I integrate this into my web application. Is it possible that I can integrate this into my other javascript jquery code? and here I need to run node index.js but do I still need to do this if I integrate with my code? const projectId = 'xxx'; //https://dialogflow.com/docs/agents#settings const sessionId = 'xxxxx'; const query = 'Hello'; const languageCode = 'en-US'; //

What would be the purpose of putting all datastore entities in a single group?

狂风中的少年 提交于 2019-12-29 02:09:31
问题 I have started working on an existing project which uses Google Datastore where for some of the entity kinds every entity is assigned the same ancestor. Example: class BaseModel(ndb.Model): @classmethod def create(cls, **kwargs): return cls(parent=cls.make_key(), **kwargs) @classmethod def make_key(cls): return ndb.Key('Group', cls.key_name()) class Vehicle(BaseModel): @classmethod def key_name(cls): return 'vehicle_group' So the keys end up looking like this: Key(Group, 'vehicle_group',

What would be the purpose of putting all datastore entities in a single group?

前提是你 提交于 2019-12-29 02:09:08
问题 I have started working on an existing project which uses Google Datastore where for some of the entity kinds every entity is assigned the same ancestor. Example: class BaseModel(ndb.Model): @classmethod def create(cls, **kwargs): return cls(parent=cls.make_key(), **kwargs) @classmethod def make_key(cls): return ndb.Key('Group', cls.key_name()) class Vehicle(BaseModel): @classmethod def key_name(cls): return 'vehicle_group' So the keys end up looking like this: Key(Group, 'vehicle_group',

Datastore: Multiple writes against an entity group inside a transaction exceeds write limit?

馋奶兔 提交于 2019-12-29 01:57:08
问题 I'm familiar with Datastore's single-write-per-second limit (ok, 5, maybe) for entity groups. How does that square with transactions? The docs seem to indicate that I can do multiple modifications inside a transaction- for example adding several descendant entities: A single transaction can modify multiple entities in a single group, or add new entities to the group by making the new entity's parent an existing entity in the group. https://cloud.google.com/appengine/docs/java/datastore

Google App Engine Datastore - Testing Queries fails

倾然丶 夕夏残阳落幕 提交于 2019-12-29 00:47:08
问题 I am currently trying to test a piece of my code that runs a query on the datastore before putting in a new entity to ensure that duplicates are not created. The code I wrote works fine in the context of the app, but the tests I wrote for that methods are failing. It seems that I cannot access data put into the datastore through queries in the context of the testing package. One possibility might lie in the output from goapp test which reads: Applying all pending transactions and saving the

Retroactive indexing in Google Cloud Datastore

。_饼干妹妹 提交于 2019-12-28 06:33:06
问题 There are many properties in my model that I currently don't need indexed but can imagine I might want indexed at some unknown point in the future. If I explicitly set indexed=False for a property now but change my mind down the road, will Datastore rebuild the entire indices automatically at that point, including for previously written data? Are there any other repercussions for taking this approach? 回答1: No, changing indexed=True to indexed=False (and vice-versa) will only affect entities

How to make case insensitive filter queries with Google App Engine?

 ̄綄美尐妖づ 提交于 2019-12-28 04:23:13
问题 I am working on a GAE Django Project where I have to implementing the search functionality, I have written a query and it fetches the data according to the search keyword. portfolio = Portfolio.all().filter('full_name >=',key).filter('full_name <',unicode(key) + u'\ufffd') The issue with this query is, that it is case sensitive. Is there any way through which I can make it to work, without depending upon the case of the keyword? Please suggest. Thanks in advance. 回答1: You need to store

Datastore admin - Unable to resolve the server's DNS address

南笙酒味 提交于 2019-12-25 09:54:48
问题 I am trying to access Datastore Admin on Google App Engine but I get Unable to resolve the server's DNS address error. The url that cannot be translated is: [https protocol]ah-builtin-python-bundle-dot-[myapp].gene.com/_ah/datastore_admin/?app_id=s~gene.com:[myapp]&adminconsolecustompage I tried with adding exceptions to coookies because when I try directly access it with [http protocol][myapp].gene.com/_ah/datastore_admin I get error with redirect loop. Any idea? Any workarounds are also

Exporting data from local standard environment and importing it in Datastore Emulator

可紊 提交于 2019-12-25 08:20:28
问题 We have two app engine apps, which read/save to the same datastore (that is, same project). Datastore is actually the way they "transfer data" to each other. One of the apps is running on standard environment, and the other is running in the flexible environment. In the flexible environment, to run local tests in my machine, without using google datastore servers, I have to use the Datastore Emulator, which it's configured already. What I would like now is to find a simple way to export data