google-cloud-datastore

gcloud Datastore transaction issue using nodejs

拜拜、爱过 提交于 2019-12-13 04:43:55
问题 I am using nodejs to contact the google datastore. This is my code: dataset.runInTransaction(function(transaction, done,err) { // From the `transaction` object, execute dataset methods as usual. // Call `done` when you're ready to commit all of the changes. transaction.save(entities, function(err) { if(err){ console.log("ERROR TRNASCTION"); transaction.rollback(done); return; }else{ console.log("TRANSACTION SUCCESS!"); done(); } }); }); If the save was not successful, I would like the

How to access GAE datastore with Objectify and service account credentials?

孤街醉人 提交于 2019-12-13 04:27:17
问题 Is it possible for one GAE application to access the datastore of another GAE application (both applications are hosted under the same Google account) using Objectify? If so, how can I pass service account credentials to Objectify (which API calls)? 回答1: It is not possible . Objectify is a very simple and convenient lightweight ORM that sits on top of a GAE Datastore , thus shielding the developer from most of the complexities of using JDO/JPA. Nowhere in the documentation have I seen the

Image which is stored as a blob in Datastore in a html page

十年热恋 提交于 2019-12-13 04:26:56
问题 I am trying to make a Web Application based on Google App Engine in python. A part of it deals with displaying the poster of Movie hosted at IMDb. I have the link to the poster. For ex. http://ia.media-imdb.com/images/M/MV5BNTM3OTc0MzM2OV5BMl5BanBnXkFtZTYwNzUwMTI3._V1._SX94_SY140_.jpg Then I tried to put it in an HTML page as: <a href="https://ia.media-imdb.com/images/M/MV5BNTM3OTc0MzM2OV5BMl5BanBnXkFtZTYwNzUwMTI3.jpg"> <img src="https://ia.media-imdb.com/images/M

Can any one explain how to Understanding Datastore Read Costs in App Engine?

筅森魡賤 提交于 2019-12-13 04:22:13
问题 I am doing geoquery among 300 user entities with a result range 10. I've maked a query for 120 times. For each query I got 10 user entity objects. After this my app engine read operations reached 52% (26000 operations). My user entity has 12 single value properties and 3 multi-value properties(List type). User entity have 2 indexes for single value properties and 2 indexes on list type properties. Can any one please help me to understand how google's appengine counts the datastore read

How do you treat a ReferenceProperty like a boolean in AppEngine Datastore?

大憨熊 提交于 2019-12-13 04:20:04
问题 I have a model which might reference another model and which has a completed_on date. class Game(db.Model): challenge = db.ReferenceProperty(Challenge, required=False) completed_on = db.DateTimeProperty(default=None) I'd like to be able to select all of the completed Challenge games that were completed before a certain time period. Problem is I can't have 2 inequalities But http://code.google.com/appengine/docs/python/datastore/queries.html says: Inequality Filters Are Allowed on One Property

App Engine JDO Transaction on multiple many-to-one

只愿长相守 提交于 2019-12-13 04:12:43
问题 I have a simple domain model as follows Driver - key(string), run-count, unique-track-count Track - key(string), run-count, unique-driver-count, best-time Run - key(?), driver-key, track-key, time, boolean-driver-update, boolean-track-updated I need to be able to update a Run and a Driver in the same transaction; as well as a Run and a Track in the same transaction (obviously to make sure i don't update the statistics twice, or miss out on an increment counter) Now I have tried assigning as

GAE: db Model property using 'name' param

为君一笑 提交于 2019-12-13 04:06:41
问题 Trying to optimise db model class property name by using name in the property. Ex. class terminals(db.Model): location_code = db.StringProperty() terminal_code = db.StringProperty(default='') start_invoice_no = db.IntegerProperty(indexed=False, default=1, name='sin') next_invoice_no = db.IntegerProperty(indexed=False) last_doc_details = db.TextProperty(default='{}') Query on terminals: terminal_qry = db.Model(terminals).all() putting happening fine into db. but while i try serialize this

Are deleted entity IDs once again available to App Engine if auto-generated for an Entity?

半城伤御伤魂 提交于 2019-12-13 03:53:20
问题 Sometimes I allocate an ID before putting a datastore entity and other times I allow app engine to auto-generate the ID. My question is: If I put an entity and then delete it, does the ID once again become available when allocating and/or allowing app engine to auto-generate an ID for a new entity? The reason I ask is I may have other entities referencing that ID (kind of like a key), so I do not want the ID's to be recycled even after an entity is deleted. I currently solve this by just

App Engine Datastore - Data Model question

送分小仙女□ 提交于 2019-12-13 03:31:01
问题 I need to design a data model for an Amazon S3-like application. Let's simplify the problem into 3 key concepts - users, buckets and objects. There are many ways to design this model - I'll list two. Three Kinds - User, Bucket and Object. Each Object has a Bucket as its parent. Each Bucket has a User as its parent. User is the root. Dynamic Kinds - Users are stored in the User kind and buckets are stored in the Bucket kind - same as #1. However objects within a bucket are stored in a dynamic

Ndb strong consistency and frequent writes

放肆的年华 提交于 2019-12-13 02:56:02
问题 I'm trying to achieve strong consistency with ndb using python. And looks like I'm missing something as my reads behave like they're not strongly consistent. The query is: links = Link.query(ancestor=lead_key).filter(Link.last_status == None).fetch(keys_only=True) if links: do_action() The key structure is: Lead root (generic key) -> Lead -> Website (one per lead) -> Link I have many tasks that are executed concurrently using TaskQueue and this query is performed at the end of every task.