Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

mongodb instructions

/**
 * 1. Create a node server with 5 steps
 * 1.1. create folder
 * 1.2. npm init
 * 1.3. npm i express cors mongodb
 * 1.4. script-dev: nodemon index.js
 * 1.5. create index.js
 * 1.6. use 5 steps to create a node server
 * 
 * -------------------
 * Create Atlas Account
 * -------------------
 * 1. sign up. google access
 * 2. create cluster
 * 3. Create user dbUser and password
 * 4. Network Access --> ip address: allow all 
 * 5. database > Connect > code copy paste in index.js
 * ---------------------
 * CRUD Operation
 * -------------------
 * 1. node mongodb CRUD > Fundamentals
 * 2. create async run function
 * ---------------------------------------------
 * Integrate sending data from client to server
 * ----------------------------------------------
 * 1. Client side: create form
 * 2. on submit get form data and create user object
 * 3. on Server: Create user POST method to receive data on the backend 
 * 4. on client side: set fetch with POST, headers, body
 * 5. Make sure you return a json from the POST API
 * ---------------------------
 * LOAD Data to the client side
 * -------------------------------
 * 1. create get API on the server
 * 2. create a query object
 * 3. collection.find (query)
 * 4. cursor.toArray()
 * 5. return the result
 * 6. from client useEffect and display like you have done before
 * ---------------------------
 * DELETE
 * ---------------------------
*/
Comment

PREVIOUS NEXT
Code Example
Javascript :: JSON of first block in cryptocurrency blockchain 
Javascript :: expact 
Javascript :: javascript variable scope in if statement 
Javascript :: &quot in json 
Javascript :: Update react final form field 
Javascript :: discord.js sync channel permissions 
Javascript :: Backbone Add To Collection 
Javascript :: country select dropdown javascript 
Javascript :: computed properties in react 
Javascript :: javascript count number of lines of a text 
Javascript :: js check that interactive element is not focused 
Javascript :: update excel file in react js using sheetjs 
Javascript :: how to check leap year in javascript 
Javascript :: electron npm start not working 
Javascript :: javascript invert number 
Javascript :: how to scroll automatically to the bottom of the page using javascript 
Javascript :: react color picker 
Javascript :: vuejs methods 
Javascript :: events node.js 
Javascript :: noise expression after effects 
Javascript :: _.isString 
Javascript :: Accessing HTML attributes in DOM 
Javascript :: truthy or falsy 
Javascript :: reading an array from python to js 
Javascript :: JavaScript Generator Function With return 
Javascript :: cntl intellisense tailwind 
Javascript :: promise limit time 
Javascript :: window alert javascript css 
Javascript :: phaser wrap in camera bounds 
Javascript :: chakra ui with humburger menu 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =