1 00:00:00,210 --> 00:00:05,850 In this hour, we are going to talk about the mongoose and we were going to use the mongoose, but what 2 00:00:05,850 --> 00:00:06,510 is Mongoose? 3 00:00:06,510 --> 00:00:12,000 Mongoose provide a straightforward schema based solution to the models of applications. 4 00:00:12,240 --> 00:00:20,680 And Bongo is a Jimenez and Mongoose schema is a document data structure that is enforced. 5 00:00:20,850 --> 00:00:27,690 We had an application data, their schema pairwise, what properties it should have and types of properties. 6 00:00:27,930 --> 00:00:31,410 In our case, we are working with items. 7 00:00:31,440 --> 00:00:39,010 So we have a schema for an item that have two properties and one is the name and the other is the price. 8 00:00:39,930 --> 00:00:46,720 Models are the fancy constructor come apart from the schema definitions and instead of a model is called 9 00:00:46,720 --> 00:00:55,290 a documents and models are responsible for creating and reading documents from the underlying Mongo 10 00:00:55,290 --> 00:00:56,230 DB database. 11 00:00:56,760 --> 00:01:03,990 So in this documentation, you can see we can use the model to construct the documents by using the 12 00:01:03,990 --> 00:01:05,450 model box safe. 13 00:01:05,460 --> 00:01:11,520 And we can also do some search, for example, by using the fight or flight by IP. 14 00:01:11,730 --> 00:01:19,750 We can also delete a document and of course, we can also update the document and the back to our project. 15 00:01:20,100 --> 00:01:27,140 We already have the link of the Mongo DB and first of all, we have to install the mongoose. 16 00:01:27,240 --> 00:01:32,100 So we have to use NPM install both. 17 00:01:34,810 --> 00:01:45,370 First, we are going to impose the mongoose by using the constant mongoose is going to require mongoose 18 00:01:45,940 --> 00:01:52,180 and then we type Mongoose thought on that, the Mongo DB. 19 00:01:53,760 --> 00:02:01,560 And since this is a MySpace and so we can use then and every little dialogue connected. 20 00:02:03,220 --> 00:02:10,260 And then we used to catch error and also thought Laub error. 21 00:02:10,840 --> 00:02:16,210 Now we can go to the terminal and start the server again by using the phone app. 22 00:02:16,750 --> 00:02:22,450 Now, you can see there are some warnings here and we also have to connect to this. 23 00:02:22,730 --> 00:02:31,690 So actually we can connect to the database already, but it is better to costis options to stop the 24 00:02:31,690 --> 00:02:32,260 warning. 25 00:02:32,470 --> 00:02:36,580 So we paste it to our mongoose stock on that. 26 00:02:36,580 --> 00:02:39,340 And we also copied this one. 27 00:02:41,180 --> 00:02:50,870 And here, so we save it and now you can see the Collinet and we don't want to listen to requests until 28 00:02:50,870 --> 00:02:52,240 the conversion is complete. 29 00:02:52,250 --> 00:02:57,860 So it is also better to take this and pass it inside the brocke.