I want to check with mongodb if nickname and password are true im trying to use the $and operator with $regex but I can't get it work. Can someone help me a hand with it currently have this;
checkNickname: function(nickname, password){
    var reNick = new RegExp(nickname, "i"),
        rePass = new RegExp(password, "i");
    getProfile.find( { $and :  [{
        nickname: { $ne: { $regex: reNick } } },
        { password: { $ne: { $regex: rePass} } } 
    ]}, function(data){
        console.log(data)
    });
},
 
     
     
    