The actual problem I'm trying to solve is that I want an array of foreign keys to use in a new query. To get the foreign keys, I run
_.pluck( db.users.find(...).toArray(), "_id")
then I use that in an $in query.
Creating a group aggregation to do this takes too long. Is there a way I can easily copy the contents of a column into an array? That would be awesome.
The actual problem I'm trying to solve is that I want an array of foreign keys to use in a new query. To get the foreign keys, I run
_.pluck( db.users.find(...).toArray(), "_id")
then I use that in an $in query.
Creating a group aggregation to do this takes too long. Is there a way I can easily copy the contents of a column into an array? That would be awesome.