Google AppEngine Go 数据存储区中最大的数据类型是什么。我遇到了字符串类型的限制,它只允许 500 个字符。谢谢你!
最佳答案
使用一个[]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 MB。
关于go - GAE GO 数据存储中最大的数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14323901/