You can also utilize R or python for this:
Names Default To Here( 1 );
R Init();
R Submit("
library(mongolite)
connection_string = 'mongodb+srv://<username>:<password>@<cluster-name>.mongodb.net/sample_training'
trips_collection = mongo(collection=\!"trips\!", db=\!"sample_training\!", url=connection_string)
trips_collection = mongo(collection=\!"trips\!", db=\!"sample_training\!", url=connection_string)
user_types = trips_collection$aggregate('[{\!"$group\!":{\!"_id\!":\!"$usertype\!", \!"Count\!": {\!"$sum\!":1}}}]')
df <- as.data.frame(user_types)
");
dt = R Get(df);
R Term();
Example R Syntax is from: https://www.mongodb.com/languages/mongodb-and-r-example