在Go运行时中,是否可以使用Python的property类来操作Datastore?

huangapple go评论80阅读模式
英文:

Is it possible to use Python's property classes for Datastore from the Go runtime?

问题

我正在使用GAE(Managed VMs)上的Go运行时与Datastore。最近我发现了这个页面,它讨论了与Python运行时和Expando相关的类型和属性类。

我想在Go中使用对ListProperties的查询。这可能吗?当然,我知道google.golang.org/appengine/datastore没有暴露这个功能。

英文:

I am using the Go runtime on GAE (Managed VMs) with Datastore. Just recently I found this page that talks about Types and Property classes in connection with the Python runtime and Expando.

I would like to use queries against ListProperties from Go. Is that possible? Of course I know that google.golang.org/appengine/datastore does not expose this feature.

答案1

得分: 1

根据我所了解,Golang的数据存储API支持列表属性。因此,你应该可以在Python中使用ndb.StringProperty(repeated=True)作为属性,在Go语言中使用[]string,它们应该可以很好地互操作。

英文:

The golang datastore API supports list properties as far as I know. So you should be able to have a property that is a ndb.StringProperty(repeated=True) in python and []string in go and they should interoperate fine.

huangapple
  • 本文由 发表于 2015年8月14日 04:22:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/31997736.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定