i have looked all around trying to find a solution for this but i cant seem to find it
i am trying to see if a certain row exist in my nedb database and if it doesnt exist insert something but if it does exist then just move along here is what i have tried
function newAgent(pcName){
socket.broadcast.emit('newAgent', pcName)
agentList.find({agentName: { $nin: pcName}}, function(err, docs) {
agentList.insert({agentName: pcName}, function (err) {});
});
}
now i might be doing something stupid but im new to nedb so i have no idea what to use