搜索

45.12. 类型转换

download PDF

camel-mongodb 组件中包含的 MongoDbBasicConverters 类型转换器提供以下转换:

Namefrom type要键入如何?

fromMapToDocument

Map

文档

创建一个新的 Document,通过 new Document(Map m) constructor。

fromDocumentToMap

文档

Map

已实施 映射

fromStringToDocument

字符串

文档

使用 com.mongodb.Document.parse (字符串 s)。

fromStringToObjectId

字符串

ObjectId

通过新的 ObjectId s 构建新的 ObjectId。

fromFileToDocument

File

文档

在 hood 下使用 fromInputStreamToDocument

fromInputStreamToDocument

InputStream

文档

将 inputstream 字节转换为 文档

fromStringToList

字符串

list<Bson>

使用 org.bson.codecs.configuration.CodecRegistries 转换为 BsonArray,然后转换为 List<Bson>。

这个类型转换器是自动发现的,因此您不需要手动配置任何内容。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.