Search for a line starting with a prefix in the Google App Engine data store

I want to search for all objects whose name begins with a specific line, is this possible in the Datastore?

I tried this:

q = datastore.NewQuery("Places").Filter("Name > ", "a")

But that will not work.

If this is not possible, what alternative solution can you offer me? BigQuery? BigTable or other services in App Engine?

+4
source share
1 answer

This is what is possible, but with a combination of two inequality filters.

, Places "li". , Places, ( ) "li" , "li" : "lj".

GQL:

SELECT * FROM Places WHERE Name > 'li' AND Name < 'lj'

Coded in Go :

q = datastore.NewQuery("Places").Filter("Name >", "li").Filter("Name <", "lj")

Places, :

liam
lisotto
lizst

, :

abc
ljoi
lj
qwerty

: , "List" "li" ( "List" , "li")!

+4

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


All Articles