google-cloud-datastore

Appengine ZigZag Merge Join Algo

十年热恋 提交于 2019-12-10 16:01:11
问题 I have question on zigzag merge join algorithm. In article https://developers.google.com/appengine/articles/indexselection , mentioned Index(Photo, owner_id, -date), Index(Photo, size, -date) can be combine to become Index(Photo, owner_id, size, -date) ; My test below: <datastore-index kind="KindTest1" ancestor="false" source="auto"> <property name="hideIt" direction="asc"/> <property name="voteCount" direction="desc"/> </datastore-index> <datastore-index kind="KindTest1" ancestor="false"

Node pagination in google datastore

心已入冬 提交于 2019-12-10 15:35:29
问题 I am having trouble doing the pagination with Google Datastore. I have a query which without the limit has a few hundred results. I would like to retrieve 5, send them back to the user, if the user wants more they would retrieve the next 5. Following the docs I create the query: var query = datastore.createQuery('ResultsKind').filter('name', 'bobby').limit(5).autoPaginate(false); I then run this query to get the first 5 results: datastore.runQuery(query, callback); This is the callback

How do I integrate filepicker.io with google app engine (blobstore)?

半腔热情 提交于 2019-12-10 15:27:20
问题 So I'm trying to use filepicker.io with a GAE application. The filepicker widget returns the URL of the file that a user uploaded. How do I then use this url to upload the file to GAE's blobstore? The blobstore only supports "file uploading through a form", so the real question is how to fake a form POST containing the URL of a file. 回答1: Faking a form post is possible, but it's much simpler to use the Files API Edit: To use the File API with urlfetch you would write something like this: from

Java and Python Together in Single Google App Engine Project

℡╲_俬逩灬. 提交于 2019-12-10 14:55:32
问题 I currently have a Java application running on Google App Engine, but I want to add the features that the Python module's SearchableModel provides (for search features of course). Is it possible to run python code in the same project as Java code, just under a different version? If not, could they be two separate apps (current Java app and a new Python-based search app) running against a single datastore, but I don't think that is possible. 回答1: It is possible to run Python and Java

How to add a composite index in Google Datastore?

瘦欲@ 提交于 2019-12-10 14:22:11
问题 I'm now using Google Datastore for my company's database. Today, I made a index and it successfully listed in 'Index'. But the size and entities of index which I made is empty. The documentation of google Datastore says that the index is auto-genarated, but it wasn't. Is there any command or something to do to generate the index? The image below is a screenshot. The upper one is the new one. The below one is already used. 回答1: As a matter of fact existing entities will not be indexed

How can I query for direct descendants only?

眉间皱痕 提交于 2019-12-10 13:25:27
问题 Let's say I have entities a, b and c all of the same type, and the situation is like this: entity a is parent for entity b entity b is parent for entity c Now if I do the following query query = ndb.Query(ancestor=a.key) result = query.fetch() The result will contain both b and c entities. Is there a way I can filter out c so that only entities that are direct descendants remain? Any way apart from me going through the results and removing them I mean. 回答1: The only way to do this is to

NDB querying results that start with a string

依然范特西╮ 提交于 2019-12-10 10:21:00
问题 Working with Google App Engine's NDB, I'm looking to query for all items that start with a user-inputted string. Example: abc_123 abcdefg 123abc Querying for "abc" should return abc_123, abcdefg (however, not 123abc as it doesn't start with "abc") I previously used the code below for a similar but different purpose: q = q.filter(order._properties[kw].IN(values_list)) which filtered for all values in values_list that were in kw, I am now looking to filter for all values that start with a

Can Objectify library be used outside GAE?

亡梦爱人 提交于 2019-12-10 09:57:08
问题 I want to use the Google Cloud Datastore. However, I am not using GAE. Can I still use the Objectify library? If so how? The documentation doesnt say anything about how to configure it to authenticate against Datastore. 回答1: No, you can't. Here is a comment from the creator on the topic. 回答2: Objectify is meant for use within GAE only. Other ORM for Java which can interface with the Datastore, such as JDO, JPA, etc. are similar. In order to access your Datastore from the outside world, you'll

Google Datastore - Problems updating entity

笑着哭i 提交于 2019-12-10 09:53:23
问题 I am dusting off my google app-engine / datastore skills ... and getting stuck on something very simple. As per the example on the GAE documentation I am trying to update an entity as follows: // persistence and business logic PersistenceManager pm = PMF.get().getPersistenceManager(); // get it NickName n = pm.getObjectById(NickName.class, nicknameId); // update fields n.givenName = "new name"; n.nickName = "new nickname"; n.timeStamp = new Date(); // close manager to persist changes pm.close

How can I persist the local datastore for GoogleAppEngineLauncher between reboots?

江枫思渺然 提交于 2019-12-10 05:40:14
问题 I'm using GoogleAppEngineLauncher (GAEL) on Mac OS X. The state of the datastore for my application is persisted between server restarts and even GAEL restarts, but if I reboot, the datastore is reset. Is there a setting to prevent this reset, or is there a tmp file somewhere that I can save off? 回答1: Click on Edit -> Application Settings Under 'Extra Flags', enter "--datastore_path=/Users/yourname/somewhere" Enjoy your now-permanent datastore. 来源: https://stackoverflow.com/questions/1547087