You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nick Busy (JIRA)" <ji...@apache.org> on 2016/11/03 12:25:58 UTC

[jira] [Created] (CAMEL-10443) findById does not work with ObjectId

Nick Busy created CAMEL-10443:
---------------------------------

             Summary: findById does not work with ObjectId
                 Key: CAMEL-10443
                 URL: https://issues.apache.org/jira/browse/CAMEL-10443
             Project: Camel
          Issue Type: Bug
          Components: camel-mongodb
    Affects Versions: 2.18.0
            Reporter: Nick Busy


When using Camel MongoDB component with "operation=findById" and [_id] field is happened to be a standard ObjectId(), it doesn't work anymore in v.2.18 (worked 2.17.3 and before). 
Basically, to test you'd need to send org.bson.types.ObjectId in the message body but it never finds a document. 
The problem lies in MongoDbProducer.createDoFindById(). 
Can be fixed by replacing line: 
                String id = exchange1.getIn().getMandatoryBody(String.class); 
with 
                Object id = exchange1.getIn().getMandatoryBody(); 




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)