gql

How to construct GQL to not contain a value from a set?

丶灬走出姿态 提交于 2019-12-01 21:55:19
Is it possible to select from a google app engine db where the key of a db.Model object is not in a given list? If so, what would be the syntax? Ex of a model class: class Spam(db.Model): field1 = db.BooleanProperty(default=false) field2 = db.IntegerProperty() Example of a query which I'd like to work but can't figure out: spam_results = db.GqlQuery( "SELECT * FROM Spam WHERE key NOT IN :1 LIMIT 10", ['ag1waWNreXByZXNlbnRzchMLEgxBbm5vdW5jZW1lbnQYjAEM', 'ag1waWNreXByZXNlbnRzchMLEgxBbm5vdW5jZW1lbnQYjgEM']) for eggs in spam_results: print "id: %s" % a.key().id() No Though app engine supports an

Search a string beginning with a prefix in Google App Engine Datastore

丶灬走出姿态 提交于 2019-12-01 19:37:39
I want to search all entities whose name starts with a specific string, is this possible in Datastore? I've tried this: q = datastore.NewQuery("Places").Filter("Name > ", "a") But it doesn't work. If this is not possible, what alternative solution can you suggest to me? BigQuery? BigTable or other services on App Engine? This is something that is possible, but with a combination of 2 inequality filters. Let's say you want to list Places that have the "li" prefix. This can be described with a query that lists Places that are greater than (or equal to) "li" and less than a prefix that is the

Google Datastore Composite index issue

╄→гoц情女王★ 提交于 2019-12-01 06:43:41
I am getting below exception : Exception in thread "main" com.google.cloud.datastore.DatastoreException: no matching index found. recommended index is: - kind: cp_outbox properties: - name: format - name: occasion_name - name: sent_datetime - name: status - name: send_date While running below query : SELECT * FROM cp_outbox where send_date <= '2018-03-14' and sent_datetime is null and format='test1' and status=0 and occasion_name='test' So I am using inequality operator in query and I have composite index for that : But still I am getting exception. By looking at error I think the ordering of

Google Datastore Composite index issue

时间秒杀一切 提交于 2019-12-01 04:17:47
问题 I am getting below exception : Exception in thread "main" com.google.cloud.datastore.DatastoreException: no matching index found. recommended index is: - kind: cp_outbox properties: - name: format - name: occasion_name - name: sent_datetime - name: status - name: send_date While running below query : SELECT * FROM cp_outbox where send_date <= '2018-03-14' and sent_datetime is null and format='test1' and status=0 and occasion_name='test' So I am using inequality operator in query and I have

Select columns by name rather than letter in Google Query Language (GQL) with Google Spreadsheets?

此生再无相见时 提交于 2019-11-30 19:49:34
newbie question, is it possible to select columns by name rather than letter when using Google Query Language with Google Spreadsheets? This works fine for me: "SELECT A, COUNT(B) GROUP BY A" It'd be great if I could use the column headers in the first row, more like a database, as in: "SELECT student, COUNT(detention) GROUP BY student" I suspect it's not possible, but hope this yet another case where my Internet search skills failed me. This is currently not possible. The GQL documentation states[1] "Columns are referenced by the identifiers (not by labels). For example, in a Google

Does GQL support commonly available SQL Style aggregation?

蓝咒 提交于 2019-11-30 14:07:40
What I'm looking for a simple Aggregate Functions that are widely available in versions of SQL. Simple things like Select Count(*) from table1 to the more complex. If these are available, is there some documentation you could point me to? Thanks - Giggy The SQL aggregate functions are not available. What you want to do is follow patterns like the sharded counters example: http://code.google.com/appengine/articles/sharding_counters.html which explain that instead of aggregating the values on queries, you want to keep the counters up to date when the values are inserted, updated, or deleted. The

How to implement internet high scores in Google App Engine

≡放荡痞女 提交于 2019-11-30 11:09:23
问题 I want to implement internet high scores for my game. And give feedback to players which place they have (not only top100 or something like that). In normal SQL it would look like that: SELECT COUNT(*) FROM Scores WHERE points > :newUsersPoints and GQL have something similar db.GqlQuery("SELECT * FROM Score WHERE points > :1", newUsersPoints).count() but since count() is limited only to 1000 it won't be very useful in my case. Do you have any ideas on how to implement this? I have two First:

Why Google's BigTable referred as a NoSQL database?

雨燕双飞 提交于 2019-11-30 10:30:32
From Wikipedia: Notable production implementations [of NoSQL databases] include Google's BigTable, Amazon's Dynamo and Cassandra. But Google's BigTable does have some variant of SQL, called GQL . What am I missing? NoSQL is an umbrella term for all the databases that are different from 'the standard' SQL databases, such as MySQL, Microsoft SQL Server and PostgreSQL. These 'standard' SQL databases are all relational databases, feature the SQL query language and adhere to the ACID properties . These properties basically boil down to consistency . A NoSQL database is different because it doesn't

Select columns by name rather than letter in Google Query Language (GQL) with Google Spreadsheets?

倖福魔咒の 提交于 2019-11-30 03:58:20
问题 newbie question, is it possible to select columns by name rather than letter when using Google Query Language with Google Spreadsheets? This works fine for me: "SELECT A, COUNT(B) GROUP BY A" It'd be great if I could use the column headers in the first row, more like a database, as in: "SELECT student, COUNT(detention) GROUP BY student" I suspect it's not possible, but hope this yet another case where my Internet search skills failed me. 回答1: This is currently not possible. The GQL

Why Google's BigTable referred as a NoSQL database?

给你一囗甜甜゛ 提交于 2019-11-29 15:46:04
问题 From Wikipedia: Notable production implementations [of NoSQL databases] include Google's BigTable, Amazon's Dynamo and Cassandra. But Google's BigTable does have some variant of SQL, called GQL. What am I missing? 回答1: NoSQL is an umbrella term for all the databases that are different from 'the standard' SQL databases, such as MySQL, Microsoft SQL Server and PostgreSQL. These 'standard' SQL databases are all relational databases, feature the SQL query language and adhere to the ACID