Compass pipeline export to Java not producing same results

I updated the post with the document format in JSON.
I tried @aggregation but it gives me this error
org.bson.BsonInvalidOperationException: readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is ARRAY.
I removed the array brackets and it worked but in this case it only returned the results from thefirst match in the pipelline . I also tried setting the pipeline value but still got the same results.