I come from RDBMS background and finding it difficult to get myself aligned with mongodb and have been struggling to generate just the array of values. Once i get the array, I need to use these array values in $condition clause of aggregate function using $in
I have a collection which returns me :
db.Users.find({user_id : 1623}, { "Friends" : 1, _id : 0})
And content:
{ "Friends" : [ 708, 784, 1495, 212, 1918, 2007, 1439, 1634, 649 ] }
I would only require the array of values than document type:
[ 708, 784, 1495, 212, 1918, 2007, 1439, 1634, 649 ]
Is there a easier way to achieve this.