I am trying to fulfill a filter request for a set of objects in a data warehouse, but the field of the object to which I am trying to execute a query with the equality operator is of type [] bytes, and I do not know if the appengine datastore can perform this comparison
This is my essence:
type Data struct { Id int64 `json:"id"` Version int32 `json:"-"` HMAC []byte `json:"-"` Status string `json:"status"` }
And here is my query logic
func (view *DataView) GetDataByHMAC(hmac []byte) (Data, error) { view_key := datastore.NewKey(view.context, "View", "data-view", 0, nil) data := make([]Data, 0) query := datastore. NewQuery("ViewData"). Ancestor(view_key). Filter("HMAC = ", hmac) _, err := query.GetAll(view.context, &data) if err != nil { return Data{}, err } if len(data) == 0 { return Data{}, ErrNoData } return data[0], nil }
It builds but does not return any results even after a software retry for 10 seconds, so I donβt think this is a problem of possible consistency between the data store and the viewing data that I store there.
My main question is: does the appengine datastore allow me to use a query to use a comparison filter in a field of type [] byte?
source share