I'm using MongoDB atlas on my flutter app, the data is going to be used through an API, I can now add documents and basic stuff, but I'm not really familiar with the aggregation pipeline, but I need to retrieve the number of all documents in my database. This is how aggregation pipeline should look:

Can someone tell me how can I retrieve the number of all documents with the pipeline using API. I've been experimenting but I'm really not familiar with the aggregation pipeline.
Thank you in advance!