Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个以 Salat 期望的方式定义的产品案例类。
case class Product(@Key("product_id") productId: String, @Key("png_image_binary") pngImageBinary: ???)
如何添加 pngImageBinary 以便将其存储为二进制对象?
对于二进制数据,您可以使用Array[Byte]. 它相当于 java byte[],映射到BinaryBSON 类型。从 mongodb 文档中检查java 类型和BSON 类型。
Array[Byte]
byte[]
Binary