1 00:00:02,220 --> 00:00:04,070 That's it for this module, 2 00:00:04,230 --> 00:00:06,000 again we learned quite a lot, 3 00:00:06,000 --> 00:00:11,640 we had a detailed look at update one and update many. Update one and many can be used to update 4 00:00:11,640 --> 00:00:12,210 guess what, 5 00:00:12,210 --> 00:00:14,610 one or more documents in a collection. 6 00:00:14,880 --> 00:00:22,350 As a first argument, these methods take a filter, a query selector which narrows down which document or 7 00:00:22,350 --> 00:00:24,130 documents to update 8 00:00:24,600 --> 00:00:30,570 and then in the second argument, you can describe the update with the help of update operators, like 9 00:00:30,570 --> 00:00:32,360 $set. 10 00:00:32,400 --> 00:00:36,610 Now I didn't dive into it in this module but I covered it earlier in this course, 11 00:00:36,660 --> 00:00:44,130 there also is the option to entirely replace a document with the old update method, so not update one 12 00:00:44,130 --> 00:00:47,660 or many but just update or with replace one, 13 00:00:47,790 --> 00:00:52,920 so if you have a use case where you need to replace the entire document and just keep its ID, you can 14 00:00:52,920 --> 00:00:54,750 do that too. 15 00:00:54,750 --> 00:01:00,420 Now back to the update operators though, you learned about a lot of different update operators for updating 16 00:01:00,420 --> 00:01:04,540 the fields, with $set, inc, min and so on. 17 00:01:04,560 --> 00:01:10,050 Now if you work with arrays, you should definitely take advantage of the different shortcuts like $, 18 00:01:10,110 --> 00:01:18,240 $[] or dollar with the identifier and then the array filters key or configuration 19 00:01:18,270 --> 00:01:23,880 you add to the third argument of update many or update one, where you could also add upsert and so 20 00:01:23,880 --> 00:01:24,780 on. 21 00:01:24,780 --> 00:01:26,590 So this is something you should keep in mind 22 00:01:26,730 --> 00:01:33,330 and of course use the array update operators like $push or $pop. This allow you 23 00:01:33,330 --> 00:01:37,110 to efficiently add or remove elements to or from arrays.