MongoDb 筆記
推薦
##MongoDb可視化操作介面 https://git.oschina.net/xiexiao04/mongo-exprss-master
##安裝MongoDb 安裝 http://www.mongodb.org/downloads 安裝windows 64-bit 2008 R2+ 安裝32-bit 會有2G限制
點擊Msi檔案開始安裝,安裝完成之後,可能會在下方位置 C:\Program Files\MongoDB\Server\3.0\bin
加入環境變數: PATH: ………;C:\Program Files\MongoDB\Server\3.0\bin
以終端機操作,開啟Mongodb Server
> mongod.exe
確定啟動 前往 http://localhost:27017 預設port,如果成功啟動會顯示: It looks like you are trying to access MongoDB over HTTP on the native driver port. 打開terminal,輸入mongo 啟動database
> mongo
預設會連結到 test 資料庫 並且是以javascript shell的方式運行,因此js與法在這裡面通常都可以執行
##資料庫 顯示目前所有資料庫
> show dbs
建立或登入資料庫 建立跟登入資料庫,都是使用use
> use 資料庫名稱
//switched to db 資料庫名稱
顯示資料庫中所有資料表
//先登入資料庫
> use 資料庫名稱
//顯示資料庫中所有資料表
> show collections
基本CRUD (參考)
假設資料表名稱為 person
Continue Reading