MongoDBをちょっとだけ触ってみたよ
- 作者: 佐々木達也
- 出版社/メーカー: 秀和システム
- 発売日: 2011/04/26
- メディア: 大型本
- 購入: 8人 クリック: 859回
- この商品を含むブログ (29件) を見る
環境:Ubuntu 10.04 LTS Server 32bit
使ってみる
$ mongo > show dbs admin local > help HELP show dbs show database names show collections show collections in current database show users show users in current database show profile show most recent system.profile entries with time >= 1ms use <db name> set curent database to <db name> db.help() help on DB methods db.foo.help() help on collection methods db.foo.find() list objects in collection foo db.foo.find( { a : 1 } ) list objects in foo where a == 1 it result of the last line evaluated; use to further iterate > show users > show profile db.system.profile is empty Use db.setProfilingLevel(2) will enable profiling Use db.system.profile.find() to show raw profile entries > db.users.save({ name : "sasaplus1" }) > show dbs admin local test > show collections system.indexes users > db.users.find() { "_id" : ObjectId("4de64b50658babaabed11c45"), "name" : "sasaplus1" } > bye
まだまださっぱりわかんない。
でもまあ、特に設定しなくてもいきなり値を書き込めるってのはわかった。これは確かにお手軽かも。
レプリケーションとかも機能的にできるみたいだし、いろいろ触って覚えたいなー。RDBまともに扱えないし。