google-cloud-datastore

what is the GQL count query

落爺英雄遲暮 提交于 2019-12-11 16:42:18
问题 In the interest of time, I do mean GQL, as in SELECT * FROM Song WHERE composer = 'Lennon, John' The following failed SELECT COUNT(*) FROM myEntity also the following SELECT COUNT() FROM myEntity 回答1: As shown here, there is actually a way to count the return of your GQL. The doc about the GQL language shows you can't really do a count on the query itself. So what you would do is take your select *, put it in a GQL query object, then call the "count()" method on that object to have the count

How to connect Google App Engine (PHP) with Cloud Datastore?

左心房为你撑大大i 提交于 2019-12-11 16:18:31
问题 I am trying to connect my Local Development Site (using PHP) to Cloud Datastore, but unfortunately I do not know how to set up my code to reach the Datastore. I have tried the solution of tomwalder/php-gds, but I do not know, how to set up the code to work with my site. After the installation with composer, I do not know which file should be modified, there is no config.php in my directory. There are also no Google Documentation about Datastore for PHP. I am open for any solution to connect

firebase cloud functions limit children

旧巷老猫 提交于 2019-12-11 16:17:01
问题 Thank you I am deploying a function to limit the child nodes generated from push command.The link I am following code to limit child node Now I am just editing this code putting my custom code as follows link: 'use strict'; const functions = require('firebase-functions'); // Max number of lines of the chat history. const MAX_LOG_COUNT = 1; // Removes siblings of the node that element that triggered the function if there are more than MAX_LOG_COUNT. // In this example we'll keep the max number

Accessing Google Cloud Datastore locally from ASP.NET throws Grpc.Core.RpcException: “Missing or insufficient permissions.”

青春壹個敷衍的年華 提交于 2019-12-11 16:16:17
问题 I'm following the Using Cloud Datastore with .NET tutorial. At some point it says that you can run the provided project locally by just pressing F5. When I do that I get the following exception Grpc.Core.RpcException: 'Status(StatusCode=PermissionDenied, Detail="Missing or insufficient permissions.")' This exception is thrown exactly at the _db.RunQuery(query) line. var query = new Query("Book") { Limit = pageSize }; if (!string.IsNullOrWhiteSpace(nextPageToken)) query.StartCursor =

Can't import datastore in Google App Engine

谁都会走 提交于 2019-12-11 15:26:29
问题 I'm trying to import datastore to my code in GAE like this way, from google.cloud import datastore unfortunately I got some error message in stackdriver like this from grpc._cython import cygrpc as _cygrpc ImportError: dynamic module does not define init function (initcygrpc) or like this from google.cloud.datastore_v1 import types ImportError: cannot import name types anyone know the reason or something? thanks in advance ==== env: standard language: python runtime: python27 回答1: That is the

AppEngine's entity group write limit is very limiting in real life application?

匆匆过客 提交于 2019-12-11 15:18:39
问题 I'm thinking about introducing entity groups in my application to enable strong consistency. Propose I have an Order entity and a OrderRow entity with each Order as a parent for it's OrderRows. Then it would be normal to update the Order with the sum of all OrderRows when adding an OrderRow. But because the datastore is limited to 1 write per second, each time I edit/add an OrderRow it would take at least one second because of the updating of the Order. Is this correct? If so, the one second

Google App Engine Data Store Model Reference Another Class

╄→гoц情女王★ 提交于 2019-12-11 15:10:05
问题 So that you can understand the data model, I basically have cities and within each one I'll have categories and then inside each category I'll have listings. Here's what I have so far. from google.appengine.ext import db class City(db.Model): name = db.StringProperty(required=True) connections = db.ListProperty() categories = db.ListProperty() So Next, I want to add: class Category(db.Model) name = db.StringProperty(required=True) But do I need to specify that only Category should be in

Saving JSON as a value inside embedded entities in Cloud Datastore

荒凉一梦 提交于 2019-12-11 14:29:55
问题 In Google Cloud Store entities - is there a way to store JSON as the VALUE of an embedded entity property? For example, I would expect something like this: { "properties": { "someObject": { "objectValue": {"some":"sutome","json":"object"} } } } objectValue would be the type of the property Thanks 回答1: In Google Cloud Store entities - is there a way to store JSON as the VALUE of an embedded entity property? Not directly. However, what you can do is stringify the JSON object and store it as a

What is maximum value of int or long in Google App Engine datastore?

本秂侑毒 提交于 2019-12-11 14:23:26
问题 What is maximum value for IntegerProperty, LongProperty in Google App Engine Python? 回答1: IntegerProperty is an int or a long: int or long An integer value, up to 64 bits. Python int values are converted to Python long values prior to storage. A value stored as an int will be returned as a long. If a long larger than 64 bits is assigned, only the least significant 64 bits are stored. And for added clarity, you can use sys.maxint to find the actual value (run this in a shell and "import sys"

Which is better: setDefaultHighRepJobPolicyUnappliedJobPercentage(100) vs. CustomHighRepJobPolicy

我的未来我决定 提交于 2019-12-11 14:22:22
问题 I'm trying to test my app under the worst conditions for eventual consistency. It seems like there are two approaches I can use: Approach A1: setDefaultHighRepJobPolicyUnappliedJobPercentage(100) private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig() .setDefaultHighRepJobPolicyUnappliedJobPercentage(100)); source: https://cloud.google.com/appengine/docs/java/tools/localunittesting#Writing_HRD_Datastore_Tests Approach A2: