0

I am using Go lang with datastore as a database, I have to apply search on the UI table by the backend (i.e BY API). So I went through the documentation and found there is no LIKE OPERATOR is supported in datastore. I also search with regex but this is also not supported.

Still, I want to do it, Please assist with me these guys, I am really needy

// Here ParcelKind is the table name

var name string

name ="s"

q:= datastore.NewQuery(ParcelKind).Filter("Name", name%)
  • Prefix searches are possible, see [Search a string beginning with a prefix in Google App Engine Datastore](https://stackoverflow.com/questions/39279779/search-a-string-beginning-with-a-prefix-in-google-app-engine-datastore/39280135#39280135). General `like` queries are not. – icza Feb 12 '19 at 07:45

1 Answers1

0

Try This q:= datastore.NewQuery(ParcelKind).Filter("Name >=", name%)

  • We can't use '%' in the query. Though I have achieved this with Filter("Name >=", name) but it searches from the start of the string I Want to search through entire string. The second thing is that is there any alternative way to use the "OR" operator in a query. – Tushar Bhutada Feb 12 '19 at 21:33