Skip to content

Node.js, Express & MongoDB: Simple Add, Edit, Delete, View (CRUD)

License

Notifications You must be signed in to change notification settings

chapagain/nodejs-mongodb-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js, Express & MongoDB: Simple Add, Edit, Delete, View (CRUD)

A simple and basic CRUD application (Create, Read, Update, Delete) using Node.js, Express, MongoDB & EJS Templating Engine.

Blog: Node.js, Express & MongoDB: Simple Add, Edit, Delete, View (CRUD)

Start MongoDB server

sudo service mongod start

Check MongoDB server status

sudo service mongod status

Go to MongoDB shell

mongod

Show databases

show dbs

Create database named "test"

use test

Create collection(table) named "users"

> db.users.insert({name:"Mukesh Chapagain", age:88, email:"[email protected]"})
> db.users.insert({name:"Raju Sharma", age:77, email:"[email protected]"})
> db.users.insert({name:"Krishna Yadav", age:65, email:"[email protected]"})

Query collection

> db.users.find().pretty()
{
	"_id" : ObjectId("5946517675f3fc671900a6c1"),
	"name" : "Mukesh Chapagain",
	"age" : 88,
	"email" : "[email protected]"
}
{
	"_id" : ObjectId("5946517f75f3fc671900a6c2"),
	"name" : "Raju Sharma",
	"age" : 77,
	"email" : "[email protected]"
}
{
	"_id" : ObjectId("5946518375f3fc671900a6c3"),
	"name" : "Krishna Yadav",
	"age" : 65,
	"email" : "[email protected]"
}

About

Node.js, Express & MongoDB: Simple Add, Edit, Delete, View (CRUD)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published