1 00:00:02,150 --> 00:00:08,180 Now there's one more command I want to show you, for that let's cycle through the past commands to the 2 00:00:08,180 --> 00:00:11,490 command where I pushed a single hobby to Maria 3 00:00:11,800 --> 00:00:16,270 and let me change this to hiking. 4 00:00:16,340 --> 00:00:22,080 Now here I push a single object, the command I'll show you will not work with each with that array 5 00:00:22,100 --> 00:00:29,470 but if you push one object which I can do with push of course, you can also use addToSet instead. 6 00:00:29,770 --> 00:00:33,330 If I hit enter, you see one document was modified 7 00:00:33,650 --> 00:00:36,710 and if I find them all, you see hiking is there. 8 00:00:37,040 --> 00:00:43,910 The question is what is the difference to push? That should become clearer once I try the exact same 9 00:00:43,910 --> 00:00:46,710 command again. Previously with push, 10 00:00:46,880 --> 00:00:50,220 we were able to push duplicate values. 11 00:00:50,220 --> 00:00:53,550 Now you see modified count is 0, 12 00:00:53,600 --> 00:00:56,410 we get no error but you see nothing was changed 13 00:00:56,480 --> 00:01:00,680 and indeed if we look into the data, there is still only one hiking hobby. 14 00:01:00,710 --> 00:01:07,210 The difference is that addToSet adds unique values only, 15 00:01:07,220 --> 00:01:13,040 so if you try to add a value that's already part of the array, it will not be added again 16 00:01:13,160 --> 00:01:16,710 and that can of course also be helpful in some situations.