title: espress mongodb aggregation exclude docs by array of ids
body: <p>I have a search controller where I want to exclude some documents by an array of ids. Next is my aggregation:</p>
  
  <pre><code>var aggregation = [
              {
                  $geoNear:{
                      query : {
                          //_id:{$nin:user.friends}, &lt;---- user.friends is an array of id's that I want to exclude
                          "profile.age":{$gte: minAge, $lte: maxAge},
                          "approved":true
                      },
                      near: { type: "Point", coordinates: [ user.location[0], user.location[1]] },
                      limit:100,
                      maxDistance:radius*1000,
                      distanceField: "dist.calculated",
                      includeLocs: "dist.location",
                      distanceMultiplier:1/1000,
                      spherical: true
                  }
              },
              {
                  $project:{
                      online:1,
                      promoted:1,
                      location:1,
                      profile:1,
                      dist:1
                  }
              },
              { $sort : { online:-1, promoted:-1} }
          ];
  </code></pre>
  
  <p>How can I achieve that the result would exclude some doc's having an array 'user.friends' populated with the id's that needs to be excluded.
  _id:{$nin:user.friends} is not working</p>