I want to fetch a collection of documents with mongoosejs' query builder interface without a specific set of ids.
=> So I am looking after some sort of:
var query = Document.find();
query.$where('this._id !== ' + req.session.user_id);
query.exec(cb);
This example breaks down...
But how does it really work?
I don't beleave that this is the recommand way. However at least it works...
query.nin('_id', [req.session.user_id]);
If it's just one id you're looking to exclude:
query.ne('_id', req.session.user_id);