Guileasblog.etheve.euยทJun 12, 2024MongoDB - Prevent duplication in your arraysWhen we want to insert data in an array in Mongo we use $push . But it won't prevent you from inserting multiple times the same value in your array. If you want to ensure that there's no duplication. You can use : $addToSet How it works When you want...What I've learned todayMongoDBAdd a thoughtful commentNo comments yetBe the first to start the conversation.