Skip to content

Not able to store data in mongodb #399

@ninjahail

Description

@ninjahail

I am trying to store data received data(Json) from timer source in mongodb. But i am getting the below error.
org.apache.camel.component.mongodb.CamelMongoDbException:
MongoDB operation = insert,
Body is not conversible to type Documentt nor List

I am following this example online: https://dzone.com/articles/apache-camel-mongodb-component-example?fbclid=IwAR0u8VuBNWmJtIyz7RRF9iYpYD9XTHmqorMopfbxQz884HO6QSkEjqhyXsY. When I get to the steps of trying to insert {name:"Anne"} into my database by making a POST request using Postman, I keep getting this error:

org.apache.camel.component.mongodb.CamelMongoDbException:
MongoDB operation = insert,
Body is not conversible to type DBObject nor List.
The content-type I have set is raw (text).

I have tried adding .convertBodyTo("Document.class") after the from, but that gave me this error
caused by: No type converter available to convert from type:
org.apache.camel.converter.stream.InputStreamCache to the required type:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions