Spring-data MongoDb and compass aggregation export

Good evening everyone,
I’m new to MongoDb, I tried to export an aggregation from compass to the java language.

Arrays.asList(new Document("$lookup", 
    new Document("from", "indirizzi")
            .append("localField", "indirizzi")
            .append("foreignField", "_id")
            .append("as", "indirizzi")), 
    new Document("$match", 
    new Document("name", "Diego")))

I couldn’t find an example where to apply this code in Spring Boot using dependency:

<groupId> org.springframework.boot </groupId>
<artifactId> spring-boot-starter-data-mongodb </artifactId>

Can you kindly tell me how can I do? or a guide where I can find a complete example?
thank you

Hello @Diego83, welcome to the forum!

The Compass export of aggregation query to Java language creates Java code that can be used in an application that accesses MongoDB database using MongoDB Java Driver. You will find examples and the Maven dependency details in the Quick Start sub-topic of the linked page.