google-cloud-datastore

Google App Engine DB Query Memory Usage

左心房为你撑大大i 提交于 2019-11-29 15:33:42
When I run a query on a large set of small objects (15k objects with only a few short string and boolean properties), without doing anything with these objects, I see my instance's memory usage continuously increasing (70Mb increase). The memory increase doesn't look proportional to the amount of data it ever needs to keep in memory for just the query. The loop I use is the following: cursor = None while True: query = MyModel.all() if cursor: query.with_cursor(cursor) fetched = 0 for result in query.run(batch_size = 500): fetched += 1 # Do something with 'result' here. Actually leaving it

How to prevent the JSESSIONID showing in the URL [duplicate]

…衆ロ難τιáo~ 提交于 2019-11-29 15:23:05
This question already has an answer here: How to prevent adding jsessionid at the end of redirected url 1 answer Is it possible to disable jsessionid in tomcat servlet? 8 answers I have created an login page in servlet using Google Datastore, it is working fine. but sometimes its showing the JSESSIONID in the URL. How can I prevent the JSESSIONID sending through the URL? why its passing through the URL instead of request message? Add the following entry in your web.xml . <session-config> <tracking-mode>COOKIE</tracking-mode> </session-config> This will instruct the container that the client

How to make http call on DialogFlow v2 using Javascript ajax call

感情迁移 提交于 2019-11-29 15:22:53
I found this example on the official site of DialogFlow using Node.js and it is working fine, but I dont know how do I integrate this into my web application. Is it possible that I can integrate this into my other javascript jquery code? and here I need to run node index.js but do I still need to do this if I integrate with my code? const projectId = 'xxx'; //https://dialogflow.com/docs/agents#settings const sessionId = 'xxxxx'; const query = 'Hello'; const languageCode = 'en-US'; // Instantiate a DialogFlow client. const dialogflow = require('dialogflow'); const sessionClient = new dialogflow

Revert from Google Cloud Firestore to Datastore

家住魔仙堡 提交于 2019-11-29 15:11:49
I signed up for Firebase to use the new Firestore. After trying it out I decided that, for my use cases (mostly server tools) I don't need most of the features of Firestore, that are very much focused on building user interfaces, and I find the old Datastore SDKs nicer for what I'm doing. I know I could simply delete the project and create a new one but I have other things in that project that I would like to keep. Can I revert to Datastore without starting a new project? Unfortunately just as we cannot convert a project that has used Cloud Datastore to Cloud Firestore, we cannot do the

App Engine - why are there PhoneNumber, Link, Rating etc classes?

本小妞迷上赌 提交于 2019-11-29 13:21:39
I haven't found any reason for the existence of a few of the App Engine classes. There's a PhoneNumber, a Link, a PostalAddress, a GeoPt, a Rating, etc. Why are these given special treatment? They don't seem to have any smarts - e.g. geo searching. I know Link has more space than a String property, but the rest? See: http://code.google.com/appengine/docs/java/datastore/dataclasses.html Those types are 'semantic' types. They're present in the Java API for parity with the Python API. In the Python API, they define special behaviour with regards to the .to_xml() method - for example, a

Query with paging by cursor causes error because of limitations for “IN filter” in cursor() method… What should be the alternative?

左心房为你撑大大i 提交于 2019-11-29 12:44:29
I am developing a twitter like microblogging system by using the following models: class Member(db.Model): user = db.UserProperty(required=True) follower_count = db.IntegerProperty(default=0) # members following you following_count = db.IntegerProperty(default=0) # members you are following class NewsItem(db.Model): text = db.StringProperty(required=True) posted_by = db.ReferenceProperty(reference_class=Member,required=True,collection_name="posted_items") posted_on = db.DateTimeProperty(auto_now_add=True) status = db.IntegerProperty(default=1) # 0: deleted class Follow(db.Model): member = db

How do I store the private key of my server in google app engine?

随声附和 提交于 2019-11-29 12:09:50
I'm using "github.com/dgrijalva/jwt-go" to create JSON web tokens. When I hosted my server locally, I could use my private key as usual. But in GAE it won't work because I don't have access to the file system. How would you guys do it? Store the key in datastore or any other ideas? Thanks Edit: My app.yaml looks like this (below api_version and stuff): handlers: - url: /.* script: _go_app On AppEngine you don't have access to the file system of the host operating system, but you can access files of your web application (you have read-only permission, you can't change them and you can't create

Is there an Entity Group Max Size?

隐身守侯 提交于 2019-11-29 12:04:55
I have an Entity that represents a Payment Method. I want to have an entity group for all the payment attempts performed with that payment method. The 1 write-per-second limitation is fine and actually good for my use case, as there is no good reason to charge a specific credit card more frequently than that, but I could not find any specifications on the max size of an entity group. My concern is would a very active corporate account hit any limitations in terms of number of records within an entity group (when they perform their 1 millionth transaction with us)? No, there isn't a limit for

Read delay in App Engine Datastore after put()

风格不统一 提交于 2019-11-29 11:44:22
问题 I write a code for a blog/news site. Main page has 10 most recent articles and also there is an archive section with all articles sorted by modification time descending. In archive section I use pagination based on cursors and I cache results starting from the second page as pages are changed only when new article is published or existing goes to drafts for some reason. Every page has 10 articles. So when a user hits an archive page with some number (not the first one) memcache is checked for

How can a multi-property ndb query be successful without a composite index?

北战南征 提交于 2019-11-29 11:38:17
I have this entity model: class ApartCILabel(ndb.Model): project_id = ndb.IntegerProperty(indexed=True) changeset_ids = ndb.IntegerProperty(repeated=True, indexed=True) # ApartCIChangeset IDs # other properties I recently added a new type of query for these entities: keys = ApartCILabel.query(ApartCILabel.project_id == self.db_data.project_id, ApartCILabel.changeset_ids == self.key_id).fetch(keys_only=True) if keys: label = Label(db_key=keys[0], handler=self.handler) logging.debug('label found: %s' % label.name) else: logging.error('label for %s not found' % self.lid) I knew I needed a