Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10443

findById does not work with ObjectId

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.18.0
    • Fix Version/s: 2.18.1, 2.19.0
    • Component/s: camel-mongodb
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      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();

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                nbusy Nick Busy
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: