我爱编程

Express and Mongodb

2017-09-06  本文已影响0人  Komolei

Today,I learn the Express frame and the Mongodb which is a noSQL database.

  1. If you want learn MongoDB, you should deploy MongoDB first! install,to select you computer system version. So I choose the Window Server 2008.
  2. Finish the download files, you should install
  3. when you finish installing,you need run command window ,in the Window system,cmd
  4. rember you should choose a disk to runmkdir data and mkdir log mkdir db in the data directory ,finally, cd logand touch mongodb.log;
    for me ,I choose the C disk to run command
  5. ok,run `mongod --dbpath "C:\data\db" --logpath "C:data\log\mongodb.log" --serviceName "MongoDB" --install
  6. run net start MongoDB //to start service . if you stop service ,run net stop MongoDB
  7. maybe you will meet trouble,like can't find net, so should add environment path to relative MongDB,to input C:\Program Files\MongoDB\Server\3.4\bin in the path option.
  8. now ,run mongo// this will show the connection success

Mongo Database

waiting for updateing

Express

I advise to learn document of Express Chinese version

Update 📌11/25.2017

the command of the mongoDB


1. db.tablename.find().pretty()
2. db.tablename.stats;
3. var users=db.users;user.find().pretty();//can show the all record of db.users this table

the prototype of ObjectId is only.

var Id=new ObjectId();
Id //show some result 
上一篇下一篇

猜你喜欢

热点阅读