I am working on a Go application in which I have an Entity with a Property that holds an identifying token which is a random string of bytes. I am storing this property as a ByteString, and in my development environment I have been able to query for this property using a filter of the form:
// token is a []byte
idTok := datastore.ByteString(token)
q := ds.NewQuery("Entity").Filter("IDToken =", idTok)
var entities []Entity
keys, err := q.GetAll(c, &entities)
But unfortunately, when deployed as a module to GAE, this query returns the error: datastore: bad query filter value type: unsupported datastore value type: datastore.ByteString
, which is confusing since I thought the purpose of the ByteString type is to be able to index shorter amounts of binary data under 500 bytes.
I first switched over to using the ByteString type based on the second answer to this SO question: Golang - Appengine datastore filter query with []byte comparison