Skip to main content

I am using the default mongodb connector and can't see how to use the connector to search for a specific document by fields. I have the following,

 

<mongo:find-documents collectionName="nest" doc:name="Find documents" doc:id="e882996d-3af2-46f8-a638-db2f86c94e21" config-ref="MongoDB_Config" fields='#"_id"'>

<mongo:query ><![CDATA[#[{

"_id": "5f05c70ff50ecf4fb1a06135"

}]]]></mongo:query>

</mongo:find-documents>

...

 

Ok I changed to the following below, this seems to find all documents. How can I get the query to work, I will try payload. And I had to add the fields to return all fields

 

<mongo:find-documents collectionName="nest" doc:name="Find documents" doc:id="e882996d-3af2-46f8-a638-db2f86c94e21" config-ref="MongoDB_Config" fields='#""'>

 ...

 

Message        : org.bson.json.JsonParseException: JSON reader was expecting a value but found 'abc'.

Element        : lexis-nexis-mongodb-implFlow/processors/5 @ accounts-clients-info-sys:lexis-nexis-mongodb-impl.xml:53 (Find documents)

Element XML      : <mongo:find-documents collectionName="nest" doc:name="Find documents" doc:id="e882996d-3af2-46f8-a638-db2f86c94e21" config-ref="MongoDB_Config" fields="#""">

            <mongo:query>abc</mongo:query>

            </mongo:find-documents>

Error type      : MULE:UNKNOWN

1 resposta
  1. 10 de jul. de 2020, 13:20

    This is what I ended up with, this was not documented. Seems to work and filters down to a specific document. And the payload will have the search criteria.

     

    <mongo:find-documents collectionName="nest" doc:name="Find documents - Search" doc:id="e882996d-3af2-46f8-a638-db2f86c94e21" config-ref="MongoDB_Config" fields='#""'>

    <mongo:query><![CDATA[#payload]]></mongo:query>

    </mongo:find-documents>

0/9000