That's not entirely correct. Elastic and Mongo weren't using AGPL in the first place, they had MIT/Apache type licenses. Generally we're seeing open core/source startups moving to AGPL or proprietary source available licenses (Grafana, Sentry to name a few more).
MongoDB was using AGPL before they created and switched to SSPL [1]. You're right about ElasticSearch, they were Apache-2.0 before creating and switching to the SSPL + Elastic License dual license [2].