I used $not
command like this:
var nickname = 'jony';
Chat.find({
$or: [
{ 'nick': socket.nickname },
{ 'to': socket.nickname }
],
dem: { $not: /"'+nickname+'"/ }
},
function (err, docs) {});
When I used like shown below it worked, but when I tried to put a variable like shown above it doesn't work.
dem : { $not: /jony/ }
How to put a variable in the $not
operation above?