MongoDB Atlas trigger 50k records limitation

I have a trigger that deletes old data and but keeps latest 10 entries for each player for particular time. Hence, all the data should be deleted except that 10 entries. My code looks something like this.

Hi @Bhakti_Vyas - Welcome to the community.

Unfortunately i’m not able to see any code provided. Perhaps it was not pasted into the post?

Note: Please redact any personal or sensitive information before posting here.