mangoDB管理工具:http://www.mongovue.com/
操作系统:Win7 64 bit
MongoDB:http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2.0.4.zip
安装步骤:
一、在C盘或者其他盘建立文件夹MongoDB,解压下载下来的包并将bin目录里的所有文件复制到建立的MongoDB文件夹中。
二、建立批处理文件StartMongoDB.bat,内容如下:
@echo off
cd c:\MongoDB\
mongod --dbpath c:\MongoDB\data
pause
三、建立批处理文件StopMongoDB.bat,内容如下:
@echo off&title yyykkkyyyy
for /f "tokens=2" %%i in (
)do taskkill/pid %%i>nul 2>nul
四、建立批处理文件MongoDB.bat,内容如下:
@echo off
cd c:\MongoDB\
mongo
运行:
StartMongoDB.bat启动MongoDB服务器 (第一次运行时较慢,耐心等待)
MongoDB.bat启动MongoDB客户端控制台
StopMongoDB.bat关闭MongoDB服务器与所有控制台
MongoDB服务器正常启动好后会显示如下:
Sat May 05 12:05:59 [initandlisten] MongoDB starting : pid=8176port=27017 dbpat
h=c:\MongoDB\data 64-bit host=monster877-PC
Sat May 05 12:05:59 [initandlisten] db version v2.0.4, pdfileversion 4.5
Sat May 05 12:05:59 [initandlisten] git version:329f3c47fe8136c03392c8f0
cb21f8ebf
Sat May 05 12:05:59 [initandlisten] build info: windowssys.getwindowsversion(ma
jor=6, minor=1, build=7601, platform=2, service_pack='Service Pack1') BOOST_LIB
_VERSION=1_42
Sat May 05 12:05:59 [initandlisten] options: { dbpath:"c:\MongoDB\data" }
Sat May 05 12:05:59 [initandlisten] journaldir=c:/MongoDB/data/journal
Sat May 05 12:05:59 [initandlisten] recover : no journal filespresent, no recov
ery needed
Sat May 05 12:06:00 [websvr] admin web console waiting forconnections on port 2
8017
Sat May 05 12:06:00 [initandlisten] waiting for connections on port27017
MongoDB客户端控制台联机后会显示如下:
MongoDB shell version: 2.0.4
connecting to: test
>
简单使用示例:
> use monster
switched to db monster
> db.monster.find()
> db.monster.insert({"name" : "score"})
> db.monster.find()
{ "_id" : ObjectId("4fa4a840a3155a29e8e51ae8
>