【发布时间】:2012-12-28 17:38:23
【问题描述】:
google appengine go datastore 中最大的数据类型是什么。我遇到了字符串类型的限制,它只允许 500 个字符。谢谢!
【问题讨论】:
标签: go types google-cloud-datastore
google appengine go datastore 中最大的数据类型是什么。我遇到了字符串类型的限制,它只允许 500 个字符。谢谢!
【问题讨论】:
标签: go types google-cloud-datastore
使用[]byte,它可以存储up to 1 megabyte。您可以使用[]byte("Foo") 将字符串转换为字节,然后使用string() 取回字符串。
数据存储区中允许的数据类型:
- signed integers (int, int8, int16, int32 and int64),
- bool,
- string,
- float32 and float64,
- any type whose underlying type is one of the above predeclared types,
- *Key,
- time.Time,
- appengine.BlobKey,
- []byte (up to 1 megabyte in length),
- slices of any of the above.
如果您想存储更大的数据,例如大图像,请改用Blobstore。允许数据最大为 32 兆字节。
【讨论】: