I would like to run following query:
Group.find({program: {$in: [...]}}).lean().select(\'_id\')
And then NOT get following bac
Group.find({program: {$in: [...]}}) .distinct('_id')
db.collection.distinct(field, query) Finds the distinct values for a specified field across a single collection and returns the results in an array.
db.collection.distinct(field, query)
Finds the distinct values for a specified field across a single collection and returns the results in an array.
Read more.