Can I create schedule trigger or call API for run compact command automatic?

I want to create automatic schedule for run compact command because my database size is large.

Which I want to know can I write a trigger or call an api to run a compact command in my cluster ?

Thank you.

Hi @Peeraphat_Jearananta,

Welcome to MongoDB community.

Compact command is not a supported command via API or realm functions.

You should use an application driver or a shell to trigger it externally.

Best
Pavel

thank you pavel

Best regards
Peeraphat j.