How to build GQL so as not to contain values ​​from the set?

Is it possible to choose db applications from the Google engine where the object key is db.Modelnot listed in this list? If so, what will be the syntax?

Ex class models:

class Spam(db.Model):
    field1 = db.BooleanProperty(default=false)
    field2 = db.IntegerProperty()

An example of a query that I would like to work but cannot understand:

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()
+3
source share
1 answer

No. Although the application engine supports the "IN" query, it does not support the "NOT IN" query.

However, if your list of objects that you do not want is small, you can simply extract each object and filter out the ones you do not need.

, , , , . , , , , ( , , ).

+6

Source: https://habr.com/ru/post/1766844/


All Articles