Full-Stack Web Development with Vue.js and Node
Introducing MongoDB Chapter 3 This creates a connection with our Mongoose database. Now, let's run the app with the following co ...
Introducing MongoDB Chapter 3 The first line here just imports the Mongoose module. This Mongoose package provides us with sever ...
Introducing MongoDB Chapter 3 Now, to create a user, the first thing to do is to create a resource: const user_resource = new Us ...
Introducing MongoDB Chapter 3 Fetching records from Mongoose Now that we have successfully created a user, we have a record in t ...
Introducing MongoDB Chapter 3 The third parameter has a callback function attached to it. This function takes two parameters, un ...
Introducing MongoDB Chapter 3 Updating records in Mongoose Let's move on to updating a record in a collection. There are multipl ...
Introducing MongoDB Chapter 3 There are other methods we can use to update a document in Mongoose. findOneAndUpdate() This metho ...
Introducing MongoDB Chapter 3 The only difference here is that the first parameter takes a single integer value, which is the ID ...
Introducing MongoDB Chapter 3 findOneAndRemove findOneAndRemove() behaves the same way as remove() does and takes the same amoun ...
Introducing MongoDB Chapter 3 findByIdAndRemove() This is the same as findOneAndRemove(), except that this always needs an id to ...
Introducing MongoDB Chapter 3 Default validations Let's talk about some of the default validations that Mongoose provides us wit ...
Introducing MongoDB Chapter 3 As you can see, we have changed the value of the name key to an object instead of just a string. H ...
Introducing MongoDB Chapter 3 Custom validations We can also add custom validations in case the default built-in validations are ...
Introducing MongoDB Chapter 3 Remember, we cannot add nested validations in a single Schema like this: var nameSchema = new Sche ...
4 Introducing REST APIs An Application Programming Interface (API), in general, is used to get data from one application to anot ...
Introducing REST APIs Chapter 4 What is REST? REST is a web service used for exchanging data between multiple applications via a ...
Introducing REST APIs Chapter 4 Since there are multiple web services, we have to be able to choose what our requirements and ne ...
Introducing REST APIs Chapter 4 HTTP verbs HTTP verbs are the different methods that are used to define the action that we want ...
Introducing REST APIs Chapter 4 PUT The PUT request is used to create or update a record. It creates a new record if the resourc ...
Introducing REST APIs Chapter 4 201 Created: This represents the successful creation of a resource. 204 No Content: This status ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf