Well, you'll need to be familiar with the ES documents structure, and use the _size
https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-size-usage.html (which would probably require you to reindex the data). That's for ES.
For MongoDB, you'll need to use the $bsonSize
https://www.mongodb.com/docs/upcoming/reference/operator/aggregation/bsonSize/ on the task documents.
Hi GreasyRaven35 , this actually takes some more infrastructure, and can only be done using ES plugins and specific MongoDB queries
Thank you for fast reply. Could you suggest any opensourced examples even for such maybe a little bit complicated pipeline?