← ResourcesConnector migration

Migrating the MuleSoft MongoDB connector to Spring Boot

5 min read

The MuleSoft MongoDB connector maps onto Spring Data MongoDB. Operations become MongoTemplate calls or repository methods.

Operation mapping

  • mongo:find-documents → mongoTemplate.find(query, type, collection)
  • mongo:insert-document → mongoTemplate.insert(doc, collection)
  • mongo:update-documents → mongoTemplate.updateMulti(query, update, collection)
  • mongo:remove-documents → mongoTemplate.remove(query, collection)
  • mongo:count-documents → mongoTemplate.count(query, collection)

Before and after

Mule (XML)
<mongo:find-documents config-ref="Mongo_Config" collectionName="orders"/>
Spring Boot (Java)
Query query = new Query(Criteria.where("status").is("OPEN"));
List<Document> docs = mongoTemplate.find(query, Document.class, "orders");

How the conversion is validated

MongoDB is verified against a real MongoDB instance in a container — the converted app queries the actual database and responses are compared field-by-field.

Prove it on your own code

Send us one Mule application and your Postman collection. We convert it and prove the Spring Boot output matches field-by-field — on-premise, inside your environment.