在Firestore docs上,它列出了数据类型字节和文本字符串。
Data type | Sort Order | Notes
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Bytes | Byte order | Up to 1,048,487 bytes (1 MiB - 89 bytes). Only the first 1,500 bytes are considered by queries.
Text string | UTF-8 encoded byte order | Up to 1,048,487 bytes (1 MiB - 89 bytes). Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
我想知道何时使用Bytes而不是Text String是最佳的,反之亦然。
答案 0 :(得分:1)
当数据中包含UTF-8编码字符时,将使用字符串。字节用于任何其他不是UTF-8字符串的二进制数据,也不用于Firestore本机支持的任何其他数据类型。