LoginSignup
11
13

More than 5 years have passed since last update.

MongoDBのUI付き管理ツールphpMoAdminの導入

Posted at

チームにニーズがあるってことで、MongoDBのUI付き管理ツールを探してみる。
MongoDBの公式サイトでもたくさん紹介されてるね。
http://docs.mongodb.org/ecosystem/tools/administration-interfaces/

ひとまず開発環境にphpMoAdminを入れてみた。

phpMoAdmin
http://phpmoadmin.com/

名前のネタ元のphpMyAdminよろしく、1ファイルのphpで構成されている。

●インストールはお手軽。
上記ページからダウンロードしてきたzipを解凍して出てくるファイル

  moadmin.php

をphpが動くwwwサーバの公開領域に配置して、MongoDBへの接続情報を書きこんであげるだけ。

●MongoDBへの接続情報
db-server1-3の3台構成なReplicaSetに接続する場合は
下記の2定数に必要な情報を設定してあげればOK。

  MONGO_CONNECTIONに接続情報
  REPLICA_SETにtrue

moadmin.php
/**
 * To connect to a remote or authenticated Mongo instance, define the connection string in the MONGO_CONNECTION constant
 * mongodb://[username:password@]host1[:port1][,host2[:port2:],...]
 * If you do not know what this means then it is not relevant to your application and you can safely leave it as-is
 */
define('MONGO_CONNECTION', 'mongodb://db-server1:27017,db-server1:27018,db-server1:27019');

/**
 * Set to true when connecting to a Mongo replicaSet
 * If you do not know what this means then it is not relevant to your application and you can safely leave it as-is
 */
define('REPLICA_SET', true);

ーーーー

各Collection内のDocumentの構成(※)をグルーピングしたい ってのが本当の目的なんだけど、既存のプロダクトにそんな感じの機能を持ったものってあるのかな?
※既存機能のバグによりカラム名にブレがあるのだ。 例えば、'data'ってカラムであるべきところに'dada'ってカラム名のデータが混ざってるってこと。それを見つけて潰したい。

なけりゃデータぶっこ抜いて整形してグルーピングするだけやけど。

11
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
13