MongoDB and Mongoose | Creating a REST API with Node.js

Academind · 446K views · 2017 · 36:03

Open on YouTube

Web developmentDatabases & storagetutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering or following along with Node.js, Express and MongoDB projects, especially as a starter for wiring Mongoose into a REST API.

Recommended by 1 people across 1 different months, 2018 to 2018.

What it is

Part of Academind's Node.js REST API series, this tutorial adds MongoDB persistence to an Express app using Mongoose. It walks through connecting to a hosted database, defining schemas and models, and saving and fetching data from the endpoints. Max presents it as a screen-recorded coding walkthrough with linked source code.

What people said

Recommends menomanabdulla · 2018-10 · Stack Overflow · on “How can I query json files saved on server side - high level view?”

Look firstly you have to concentrate you project architecture.Architecture mainly responsible for which technology you will use.As description form you about your project,nodejs(express) and mongodb is perfect for you. if you want to work with express and mongodb there you need some npm packages like express,morgan,body-parser,mongoose here more then these. and nodejs is suitable as back-end technology for react. you can follow this [this video] tutorial for getting primary concept. Thank-you :)

Cites Santosh · 2018-04 · Stack Overflow · on “Postman request not loading node”

I am a newbie at node.js . Trying to learn from [this video] It was perfectly working fine few minutes ago. Not sure what happened. There is no error on command. Suddenly it stopped loading at postman. It was perfectly working fine with localhost:3000/orders that displayed the message message: 'Order was created', Now it stopped working for no reason. I can't debug since i am not able to see any error. [LINK] It hangs right here. [LINK] This is a orders.js route. I am having a custom message for each request it get. orders.js const express = require('express'); const router = express.Router() ; router.get('/', (req,res,next)=>{ res.status(200).json({ message: 'Orders were fetched' }); }); router.

Cites oolongloop · 2018-11 · Stack Overflow · on “How do I connect mongoose/mongodb to my React App.js file”

Most of the tutorials I am seeing use a express.js file to route all get and post requests. I am using a React component using react-router-dom, do I need to use express? If yes, what is the best way to do so? Here is what my app is looking like following along 1/4 of this tutorial so far: [this video] The mongoose code is probably misplaced and breaks the app. import React, { Component } from 'react'; import { Route } from 'react-router-dom'; import mongoose from 'mongoose'; import '../styles/App.css'; import Input from './Input'; mongoose.connect( 'mongodb://admin-01:PW@node-log-shard-00-00-ecvwz.mongodb.net:27017,node-shot-log-shard-00-01-ecvwz.mongodb.net:27017,node-shot-log-shard-00-02-ecvwz

Cites Jim · 2018-12 · Stack Overflow · on “.then is undefined when I try to save in MongoDB”

In the tuto I'm following, he doesn't use assert or any kind of things like this. It just does like i've written and it works. you can see it at 15m57 here [this video]