dqpwdai095465 2015-02-23 21:03 采纳率: 100%
浏览 48
已采纳

Google App Engine-ByteString查询失败

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

  • 写回答

1条回答 默认 最新

  • duanan1228 2015-03-23 22:25
    关注

    This issue resolved itself about a week later. Since it only appeared in the module environment, I am guessing that some piece of their code had not been updated to support the ByteString type, and now is. Works great now!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 slam rangenet++配置
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊