Currently, I have a simple Tags Collection in Meteor where I check for duplicate Tag documents before inserting:
var existingTag = Tags.findOne({name: "userInput"})
If the existingTag is undefined, then I proceed with the insertion. However, I am wondering if there is a more efficient way to achieve this using meteor mongodb syntax. Unfortunately, I couldn't find any relevant documentation on this.
Your insights would be greatly appreciated. Thank you.