【问题标题】:Largest Datatype in GAE GO DatastoreGAE GO 数据存储中最大的数据类型
【发布时间】:2012-12-28 17:38:23
【问题描述】:

google appengine go datastore 中最大的数据类型是什么。我遇到了字符串类型的限制,它只允许 500 个字符。谢谢!

【问题讨论】:

    标签: go types google-cloud-datastore


    【解决方案1】:

    使用[]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 兆字节。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-16
      • 1970-01-01
      • 2014-09-12
      • 1970-01-01
      • 2015-04-30
      • 2012-11-22
      • 1970-01-01
      • 2011-06-07
      相关资源
      最近更新 更多