Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Errors Exceptions Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Context options and parameters Supported Protocols and Wrappers Security In
mongoコマンドから接続した際にオールドタイプ(SQL脳)たる我々人類にも 調べやすい形でinsert、select、updateを行う方法を調べました。 定義参照 // use [データベース名] use [データベース名] // show databases show dbs // show tables show collections参照系 // select * from [コレクション名] db.[コレクション名].find() // select * from [コレクション名] where x=4 db.[コレクション名].find({x:4}) // select j from [コレクション名] where x=4 db.[コレクション名].find({x:4}, {j:1}) // select * from [コレクション名] limit 1 db.[コレクション
Heroku のアドオンに MongoHQ がある。16 MByte までではあるが、無料で MongoDB が使用できる。今回コレを初めて使用した。そのときのメモ。Mongoid 使用。 Herokuの設定 % heroku stack:migrate bamboo-mri-1.9.2 % heroku addons:add mongohq:free Mongoid 設定ファイル作成 config/initializers/mongoid.rb を作成。Rails のディレクトリ構成をパクパク。自動的に読み込まれるわけではないので自分で読み込むコードを書く必要あり。設定ファイルに切り出した理由は、cronを使うから。cron で行う処理でも MongoHQ に接続させる必要があるので。 require 'mongoid' Mongoid.configure do |config| if
ローカルの開発環境を整えるためにmongoDBをインストールする。 MAMPにより、ApacheとPHPは既にインストール済みなので、mongoDBをインストールしてLithiumを動かすため。 mongoDBのサイトは新設にインストール方法記載してあるので、こちらを参考にする。 http://www.mongodb.org/ まずはソースのダウンロード $ curl -O http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-1.6.5.tgz ~/Downloads/ $ cd ~/Downloads $ tar -zxvf mongodb-osx-x86_64-1.6.5.tgz x mongodb-osx-x86_64-1.6.5/ x mongodb-osx-x86_64-1.6.5/bin/ x mongodb-osx-x86_64-
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く