See https://github.com/js-demos/mongoose-demo
mkdir /tmp/express-react-mongodb-demo-db
mongod --dbpath /tmp/express-react-mongodb-demo-db
npm install
Run:
npm start
Then visit http://localhost:3000:
- You can click on the
初始化数据
to init data in mongodb, and you will see a list of students. - You can click on the
删除
button to delete a student
- How to remove data by mongoose: http://stackoverflow.com/questions/5809788/how-do-i-remove-documents-using-node-js-mongoose