google-cloud-datastore

How to access Google Cloud datastore with php?

馋奶兔 提交于 2019-12-04 03:21:38
问题 I am using Google app engine for my web app and I need to use a NoSQL database, so my best option is Google Cloud Datastore Since I can't find a way to connect it with php I can't use it. In the official documentation php is not mentioned. I want to make sure that is there a way to access it with php ? 回答1: This library may help people finding this thread Designed to make Google Datatore easy from PHP. https://github.com/tomwalder/php-gds 回答2: Accessing Google Cloud Datastore from PHP is not

What's the equivalent of Entity.all(keys_only=True).fetch(20) in NDB?

社会主义新天地 提交于 2019-12-04 03:09:19
How do I get the equivalent result of the following query in NDB? Entity.all(keys_only=True).fetch(20) I know you can pass 'keys_only=True' to the iter() method. But what if I want to perform a keys only fetch, how do I do that in NDB? Found it in the GAE NDB Docs . The answer is Entity.query().fetch(20,keys_only=True) . 来源: https://stackoverflow.com/questions/10203874/whats-the-equivalent-of-entity-allkeys-only-true-fetch20-in-ndb

Faster App Engine Development Datastore Alternative

泄露秘密 提交于 2019-12-04 02:39:53
Is there a way to use a real database(SQLite, Mysql, or even some non-relational one) as datastore for development, instead of memory/file datastore that is provided. I saw few projects, GAE-SQLite(did not seem to be working) and one tip about accessing production datastore using remote api (still pretty slow for large datasets). MongoDB works great for that. You will need: The MongoDB stub: http://github.com/mongodb/mongo-appengine-connector MongoDB: http://www.mongodb.org/display/DOCS/Downloads Some code to set it up like: code: import datastore_mongo_stub os.environ['APPLICATION_ID'] =

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-04 01:59:32
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 uploaded using multipart encoding and App Engine does not support the Servlet v3.0 standard, so I can

App Engine High Replication Datastore

两盒软妹~` 提交于 2019-12-03 23:57:12
I'm a total App Engine newbie, and I want to confirm my understanding of the high replication datastore. The documentation says that entity groups are a "unit of consistency", and that all data is eventually consistent. Along the same lines, it also says "queries across entity groups can be stale". Can someone provide some examples where queries can be "stale"? Is it saying I could potentially save an entity without any parent (ie. it's own group), then query for it very soon after and not find it? Does it also imply that if I want data to be always 100% up-to-date I need to save them all in

The API call datastore_v3.Put() required more quota than is available

こ雲淡風輕ζ 提交于 2019-12-03 23:54:06
How to reset quota if Datastore Write Operations limit is reached ? Any operation (both from admin console and from my code) on datastore reports the following error: The API call datastore_v3.Put() required more quota than is available. I have tried to disable application and wait for quota reset, but it did not work. When the app is enabled, it produces a lot of tasks that in turn try to operate on datastore, what obviously consumes the quota. Now, I have paused the task queues and will give another try waiting 24 hours. Is it the right solution ? aschmid00 The quota is reset every 24h, so

Is it possible to have a computed property on Google App Engine using Java?

廉价感情. 提交于 2019-12-03 23:07:21
问题 I have an app engine application and I want to run a query that sorts the result based on a expression involving two properties. Best way I thought of doing it so far is to create a computed/calculated property that stores the result of that expression. Although I saw that GAE in Python offers a ComputedProperty, which seems to be exactly what I'm looking for, I couldn't find an equivalent in Java. I'm currently using Objectify too, if that helps. Any ideas? 回答1: Compute your value in an

How do you NOT automatically dereference a db.ReferenceProperty in Google App Engine?

一曲冷凌霜 提交于 2019-12-03 21:44:14
Suppose I have class Foo(db.Model): bar = db.ReferenceProperty(Bar) foo = Foo.all().get() Is there a way for me to do foo.bar without a query being made to Datastore? The docs say that foo.bar will be an instance of Key , so I would expect to be able to do foo.bar.id() and be able to get the id of the Bar that's associated with foo , but it doesn't seem to work that way. PS: The part of the docs I'm referring to can be found here: http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html#ReferenceProperty and it says this: "An application can explicitly db.get() the

What is a good pattern for inexact queries in the Google App Engine Datastore?

北慕城南 提交于 2019-12-03 20:19:56
The Google App Engine Datastore querying language (gql) does not offer inexact operators like "LIKE" or even case insensitivity. One can get around the case sensitive issue by storing a lower-case version of a field. But what if I want to search for a person but I'm not sure of the spelling of the name? Is there an accepted pattern for dealing with this scenario? Quoting from the documentation: Tip: Query filters do not have an explicit way to match just part of a string value, but you can fake a prefix match using inequality filters: db.GqlQuery("SELECT * FROM MyModel WHERE prop >= :1 AND

GAE Implications of NDB hierarchy and entity groups

蓝咒 提交于 2019-12-03 20:17:26
I'm trying to better understand the implications of the deep hierarchy described in the GAE NDB docs "For example, a revision of a message that "belongs to" an owner, might have a key that looks like" rev_key = ndb.Key('Account', 'Sandy', 'Message', 'greeting', 'Revision', '2') I interpret this to mean that if I do Revision(parent=rev_key).put() then I will have an entity group at the Revision=2 level meaning ancestor queries where ancestor=rev_key will have strong consistency and writes where parent=rev_key will be limited to 1/sec. But what are the implications further up the hierarchy? For