How to update if exists otherwise insert new document in javascript/node.js? I am getting as parameter to function dictionary,if dictionary contains _id should update, othe
collection.update with upsert:true. See also here.
collection.update
upsert:true