非关系型数据库Mongodb现在已经越来越凸显出它在性能方面的优势和便利,下面是我自己的使用情况:
1:安装
请参考http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
2:安装完成之后的测试 ?在终端输入 ?mongo,如果出现如下内容说明安装时正常的。
ruby@nginx:~$ mongo MongoDB shell version: 2.0.4 connecting to: test > show dbs; admin 0.0625GB local (empty) neupals 0.0625GB > use admin; switched to db admin > show collection; Thu Jul 18 17:49:57 uncaught exception: don't know how to show [collection] > show collections; system.indexes users > db.users.find(); > use neupals; switched to db neupals > db.users.find(); { "_id" : ObjectId("51e668a4e9cfff64181feecd"), "name" : "ruby", "age" : "20", "address" : "rails", "remark" : "ruby on rails", "id" : "09a17bf7-ce10-4085-beb2-414e5f51618f" } { "_id" : ObjectId("51e6691de9cfff6418070a13"), "name" : "Java", "age" : "20", "address" : "jruby", "remark" : "java on rails", "id" : "82093834-654f-4c0a-9c62-4a124440b342" } { "_id" : ObjectId("51e75e66e9cfff66044dbcad"), "name" : "Alecchyi", "age" : "21", "address" : "21", "remark" : "21", "id" : "aea257ae-2485-4be9-ae69-bd161dd62a3e" } > exit bye
?需要说明的几点:
- 这里的show dbs,跟mysql的show databases类似
- 这里的show collections跟mysql的show tables类似
3:跟mysql类似的还有它也有个很不错的图形管理工具phpmoadmin
就一个文件moadmin.php文件,下载:http://phpmoadmin.com/
直接把moadmin.php文件拷到项目目录即可,不过默认连接的数据库是localhost的mongodb.
访问路径即可看到效果:http://localhost/moadmin.php
?
呵呵,不会不知道,会了很奇妙啊!
?