MongoDBへBoolean、バイナリ(BINARY)、Date、Timestamp、などをinsertして保存/取得する方法を紹介します。 サンプルコードはRubyを使いますが、便利なORMであるMongoidはあえて使わずに、プリミティブなドライバであるmongo-ruby-driverで実装してよりMongo Shellに近い操作を確認していきたいと思います。 今回は、そもそもMongoDBのデータ型(type)がRubyのオブジェクトにどのようにマッピングされるかを見てみます。 mongo-ruby-driverをgemからインストールしておいてください。 gem install mongo 環境 OS CentOS 5.4 ruby 1.9.3 gem 1.8.21 mongo 1.6.1 MongoDB 2.0.4 MongoDBのデータ型 まずは、MongoDBのデータ型の
MongoDBには、Http Interfaceが付属しているようです。 CouchDBと違って、データの更新等は行えないようですが、 ・サーバーのステータス ・登録されているデータの参照 これらが行えるようですので、デバッグに使えると思います。 Http InterfaceのURL URLは、 http://[サーバーIP]:28017/ となります。 ブラウザでアクセスするとこんな感じの画面が表示されます。 コレクションの内容表示 http://[サーバーIP]:28017/[データベース名]/[コレクション名]/ にアクセスすると、該当コレクションに登録されてるデータが表示されます。 ※最後のスラッシュは必須です。 試しにhttp://[サーバーIP]:28017/test/foo/にアクセスすると、こんな感じで 登録されているデータが表示されました。 表示するデータの上限指定 デー
This webpage was generated by the domain owner using Sedo Domain Parking. Disclaimer: Sedo maintains no relationship with third party advertisers. Reference to any specific service or trade mark is not controlled by Sedo nor does it constitute or imply its association, endorsement or recommendation.
以前(http://d.hatena.ne.jp/stog/20100531/1275317576)作成したコレクションをmap/reduceを使って"type"別に集計してみる。 コレクションの中身はこんな感じ。 $ mongo mytest MongoDB shell version: 1.4.4 url: mytest connecting to: mytest type "help" for help > > db.members2.find() { "_id" : ObjectId("4c03c632b4742d2998000000"), "birthday" : 342057600, "type" : "human", "name" : "おがわ", "sex" : "M" } { "_id" : ObjectId("4c03c632b4742d2998000001"), "b
長野県の飯田市と静岡県の浜松市を結ぶ三遠南信道 「国内屈指の難工事」青崩峠トンネル完成 (1 points, そのまま) by Anonymous Coward on 2025年03月03日 12時31分 attached to 雑談用ストーリー [4] Re:ジークアックス (1 points, そのまま) by poly on 2025年03月01日 10時29分 attached to 雑談用ストーリー [4] Re:内部告発 (1 points, そのまま) by Ryo.F on 2025年02月28日 23時15分 attached to 雑談用ストーリー [4] Re:パワハラの定義 (1 points, そのまま) by nekopon on 2025年02月28日 8時07分 attached to 雑談用ストーリー [4] Re:中国、新エネルギー車の「保険加入困難」が
The page has timed out If this page does not reload automatically, please refresh your browser.
まずは「集計ができる」と覚えておきましょう。 最初はこれだけで十分でしょう。 利用事例 ある日、ピカチューがつぶやきサービスでつぶやき始めました。 ピカチューのつぶやきに対して、仲間からたくさんの「いいね!」ボタンが押されました。 あなたはつぶやきサービス管理人として、ピカチューのつぶやき数と、ピカチューがゲットした「いいね!」のトータル数を集計してみましょう。 準備 Mongoクライアントを起動して、DBを作成しましょう。 ./mongodb/bin/mongo MongoDB shell version: 2.0.1 connecting to: test > use sample; switched to db sample サンプルデータ ピカチューが3回つぶやいて、「いいね!」がたくさんつきました。 > db.entries.save( {username:'pikachu',
The document describes how to use Gawk to perform data aggregation from log files on Hadoop by having Gawk act as both the mapper and reducer to incrementally count user actions and output the results. Specific user actions are matched and counted using operations like incrby and hincrby and the results are grouped by user ID and output to be consumed by another system. Gawk is able to perform the
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く