Spring Data MongoDB ofrece ScriptOperations para ejecutar scripts, registrar scripts con nombre y llamarlos después.