This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new ac50544 Regen documentation for camel-Mongodb
ac50544 is described below
commit ac50544a15a7728588605aa819dda4cdaf470db1
Author: Andrea Cosentino <[email protected]>
AuthorDate: Thu Apr 30 14:39:29 2020 +0200
Regen documentation for camel-Mongodb
---
.../mongodb/converters/MongoDbBasicConvertersLoader.java | 2 ++
docs/components/modules/ROOT/pages/mongodb-component.adoc | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git
a/components/camel-mongodb/src/generated/java/org/apache/camel/component/mongodb/converters/MongoDbBasicConvertersLoader.java
b/components/camel-mongodb/src/generated/java/org/apache/camel/component/mongodb/converters/MongoDbBasicConvertersLoader.java
index 1f1cef8..ec89297 100644
---
a/components/camel-mongodb/src/generated/java/org/apache/camel/component/mongodb/converters/MongoDbBasicConvertersLoader.java
+++
b/components/camel-mongodb/src/generated/java/org/apache/camel/component/mongodb/converters/MongoDbBasicConvertersLoader.java
@@ -37,6 +37,8 @@ public final class MongoDbBasicConvertersLoader implements
TypeConverterLoader {
(type, exchange, value) ->
org.apache.camel.component.mongodb.converters.MongoDbBasicConverters.fromStringToDocument((java.lang.String)
value));
addTypeConverter(registry, org.bson.Document.class,
java.util.Map.class, false,
(type, exchange, value) ->
org.apache.camel.component.mongodb.converters.MongoDbBasicConverters.fromMapToDocument((java.util.Map)
value));
+ addTypeConverter(registry, org.bson.types.ObjectId.class,
java.lang.String.class, false,
+ (type, exchange, value) ->
org.apache.camel.component.mongodb.converters.MongoDbBasicConverters.fromStringToObjectId((java.lang.String)
value));
}
private static void addTypeConverter(TypeConverterRegistry registry,
Class<?> toType, Class<?> fromType, boolean allowNull,
SimpleTypeConverter.ConversionMethod method) {
diff --git a/docs/components/modules/ROOT/pages/mongodb-component.adoc
b/docs/components/modules/ROOT/pages/mongodb-component.adoc
index 6555b84..1a522e3 100644
--- a/docs/components/modules/ROOT/pages/mongodb-component.adoc
+++ b/docs/components/modules/ROOT/pages/mongodb-component.adoc
@@ -205,6 +205,16 @@ from("direct:findById")
.to("mock:resultFindById");
------------------------------------------------------------------------------
+Please, note that the default _id is treated by Mongo as and `ObjectId` type,
so you may need to convert it properly.
+
+[source,java]
+------------------------------------------------------------------------------
+from("direct:findById")
+ .convertBodyTo(ObjectId.class)
+ .to("mongodb:myDb?database=flights&collection=tickets&operation=findById")
+ .to("mock:resultFindById");
+------------------------------------------------------------------------------
+
[TIP]
====
*Supports optional parameters*.