Mongo version - 4.2.6
Express JS version - 4
Angular version - 9
Node version - 13.3
How to set up to run this project.
npm i -g @angular/cli
npm install -g express-generator
Open MongoDB shell on your server by typing below command on command prompt:
> mongo
Switch to the database admin
> use admin
Create the root user
> db.createUser({user:"admin", pwd:”admin@admin", roles:[{role:"root", db:"admin"}]})
Exit from the MongoDB shell.
> exit
Connect MongoDB Again
> mongo -u admin -p admin@admin --authenticationDatabase admin
You can see the mongo connecting. Check the databases using the following
command:
> show dbs
> use admin
> db.createUser({user:"pec-admin", pwd:"admin@pec", roles:[{role:" readWrite " ,
db:"pec"}]})
> exit
go to your downloaded folder.
run the following commands
1. cd angular-crud
2. npm i
run the following commands
1. cd crud-api
2. npm i
run the following commands
1. cd angular-crud
2. ng serve --open
run the following commands
1. cd crud-api
2. npm run start
mongo -u admin -p admin@admin --authenticationDatabase admin
'Now run following in mongo shells'
> use pec
> db.students.find({}).pretty();