Please how do I go about retrieving records from MongoDB using mongoose where the Model ID doesn't match the given ID. The model is all setup properly. I am not entirely new to Node.js, mongoDB, Mongoose.
I tried using $ne:
var ID = ....
User.find({id: {$ne: ID}},
function(error, users) {
console.log(users);
callback(error, count);
});
I also tried using RegExp:
var regex = new RegExp('^((?!' + ID + ').)*$', "i");
User.find({id: regex},
function(error, users) {
console.log(users);
callback(error, users);
});