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!

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

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)