简体   繁体   English

如何在Google Cloud数据存储区中存储String [] []

[英]How to store String[ ][ ] in google-cloud datastore

I have a String[][] I need to store in google-cloud-datastore . 我有一个String[][]我需要存储在google-cloud-datastore

Google-cloud-datastore does not support multidimensional arrays or ArrayLists. Google-cloud-datastore不支持多维数组或ArrayList。 It does also not support FileOutputStream or ObjectOutputStream . 它还不支持FileOutputStreamObjectOutputStream

While it is not clear on what you are trying to store with multi-dimensional arrays, since you are asking for Streams, perhaps you could use a Blob data type. 尽管您不清楚要使用多维数组存储什么内容,但是由于您要使用Streams,也许可以使用Blob数据类型。 This means, you can serialize an object and store the resulting bytes to a field of type Blob. 这意味着,您可以序列化一个对象并将结果字节存储到Blob类型的字段中。

Like Sai said you could store it as a Blob. 就像Sai所说的,您可以将其存储为Blob。 But you wouldn't be able to query it. 但是您将无法查询它。 Would it be possible to convert the data to a hashmap or does it need to be a 2d-array? 是否可以将数据转换为哈希图,或者是否需要为二维数组?

If you don't need to query it I'd just go for the blob. 如果您不需要查询它,那我就去看看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM