Hello,
I have recently made public an app of ours ( IOS and Android). I would like to be able to get all verified accounts to see how many users have made an account in our app.
I have tried both realm-CLI and cloud functions (MongoDB Atlas App Services Admin API) to get all app users but I only seem to get back 50 accounts.
Is there a way to get all accounts in order for me to count them and return a number?
Any help pointing in the right direction will be greatly appreciated.
Best regards,
Rasvan
Hi @Rasvan_Andrei_Dumitr! I have asked internally if this is somehow capped. An alternate method I can offer is to create a small node
script.
const realm = require("realm");
const app = new Realm.app("<your-app-id>");
const totalUsers = app.allUsers().length;
console.log("Total users: ", totalUsers);
EDIT: this won’t work, see response below
I will redact my previous workaround, since this only returns a list of users that have logged onto the device (reference).
However, the Admin API supports pagination through the after
parameter. It should be possible to write a script to build a list of all users and get the count.