google-cloud-datastore

validator for repeated ndb.StructuredProperty fails to fire

三世轮回 提交于 2019-12-08 01:10:28
问题 Here is my ndb Model from google.appengine.ext import ndb from mainsite.rainbow.models.CFCSocialUser import CFCSocialUser class CFCSocialGroup(ndb.Model): def remove_duplicate(self, value): raise Exception("Duplicate user detected") name = ndb.StringProperty(required=True) created_on = ndb.DateTimeProperty(auto_now_add=True) updated_on = ndb.DateTimeProperty(auto_now=True) created_by = ndb.StructuredProperty(CFCSocialUser) members = ndb.StructuredProperty(CFCSocialUser, repeated=True,

Google Datastore Querys return stale data

会有一股神秘感。 提交于 2019-12-07 22:08:58
问题 I`m using Google App Engine and when I remove from the datastore and I list again the results, I recover stale data. What is the problem? Here is the code I use. public void remove(long id) { EntityManager em = EMFService.get().createEntityManager(); try { Todo todo = em.find(Todo.class, id); em.remove(todo); } finally { em.close(); } } public List<Todo> getTodos(String userId) { EntityManager em = EMFService.get().createEntityManager(); Query q = em .createQuery("select t from Todo t where t

data is stored on localhost but not on gae datastore?

人走茶凉 提交于 2019-12-07 21:54:53
问题 For some reason, the form I created inserts data into the db on localhost. I deployed it to gae, the form works but nothing is been inserted into the datastore? Here is my models file: from django.db import models # from django.contrib.auth.models import User # Create your models here. class Company(models.Model): id = models.IntegerField(primary_key=True); name = models.CharField(max_length=100, null=True); address = models.CharField(max_length=100, null=True); phone = models.CharField(max

ndb Models are not saved in memcache when using MapReduce

别来无恙 提交于 2019-12-07 21:07:31
问题 I've created two MapReduce Pipelines for uploading CSVs files to create Categories and Products in bulk. Each product is gets tied to a Category through a KeyProperty. The Category and Product models are built on ndb.Model, so based on the documentation, I would think they'd be automatically cached in Memcache when retrieved from the Datastore. I've run these scripts on the server to upload 30 categories and, afterward, 3000 products. All the data appears in the Datastore as expected. However

google app engine reverse key order query

杀马特。学长 韩版系。学妹 提交于 2019-12-07 19:03:27
I'm using Google App Engine (GAE) GO version of a datastore query. I want to get the list of keys in reverse order. Forward order works, but when I add the hyphen to the order clause it fails. q = q.Order("-__key__") with the error: Error: API error 4 (datastore_v3: NEED_INDEX): no matching index found. Is this a bug? or not supported? Not supported. q.Order("__key__") uses the EntitiesByKind index, which is ascending-only. See https://developers.google.com/appengine/articles/storage_breakdown#anc-indextables for details. 来源: https://stackoverflow.com/questions/25671090/google-app-engine

App engine + endpoint generating a string instead of byte array as method argument

旧城冷巷雨未停 提交于 2019-12-07 18:25:56
问题 I have GAE + endpoints working between an Android client and app engine backend. I'm now at the point where I want to store a small image as a Blob datatype using JDO. I have the following two methods in my model's backend: public byte[] getPicture() { if (picture == null) { return null; } return picture.getBytes(); } public void setPicture(byte[] bytes) { this.picture = new Blob(bytes); } However, when I generate my endpoint for my Android client, the setPicture(byte[] bytes) method

Google Datastore new pricing effect operations

妖精的绣舞 提交于 2019-12-07 18:20:03
问题 Google Datastore will have new pricing effective July 1st (https://cloud.google.com/datastore/docs/pricing) and I having trouble understanding how the changes will effect me. My KIND does have a structure to it. My kind is called MESSAGES and it looks like this for the every entity: ID FROM TO MESSAGE DATE_CREATED MISC1 MISC2 I have an index on ID , FROM , TO , DATE_CREATED , MISC1 , and MISC2 . With the new pricing: What will be the cost of inserting a new entity into this kind? If I run a

Are ndb cached read ops still counted as datastore read ops for billing purposes?

微笑、不失礼 提交于 2019-12-07 18:09:53
问题 From NDB Caching: NDB manages caches for you. There are two caching levels: an in-context cache and a gateway to App Engine's standard caching service, memcache. Both caches are enabled by default for all entity types, but can be configured to suit advanced needs. My app doesn't make any ndb caching configuration change, so it must be using the defaults - both caching levels enabled. I'm running some tests on my staging environment (a separate, dedicated GAE project) where I can totally

Spring, Hibernate with google app engine

我是研究僧i 提交于 2019-12-07 16:57:30
问题 Project Name: CarpoolDB, I have added the jar for this project in another application name Carpool. While running the Carpool app I am getting following exception. Project: Carpool. Here i am getting exception as "carpoolService" not getting autowired while running as "Google Web application" but same runs under Tomcat and beans properly get injected. @Controller public class PlacesSearchController { @Autowired CarpoolService carpoolService=null; public CarpoolService getCarpoolService() {

Google Datastore authentication issue - C#

徘徊边缘 提交于 2019-12-07 16:26:52
问题 I'm trying to connect to the Google Datastore on my account with service account credentials file (which I've created according to the documentation), but I'm encountering with authentication error while trying to insert an entity: Grpc.Core.RpcException: Status(StatusCode=Unauthenticated, Detail="Exception occured in metadata credentials plugin.") My code is: var db = DatastoreDb.Create("myprojectid"); Entity entity = new Entity{ Key = db.CreateKeyFactory("mykindname").CreateIncompleteKey()