MongoDB の collection 内の すべての key を取得する
RDBM関連データベースの table に相当する collection に key : value のペアーが保管されている、key は field に似ていますが、一つ一つのオブジェクトに入っている key は可変です。だから、RDBMの field の一覧を出すのは簡単ですが、MongoDB は collection 内のオブジェクトを巡って取ってくる必要がある。   mr = db.runCommand({   "mapreduce" : " my_collection ",   "map" : function() {     for (var key in this) { emit(key, null); }   },   "reduce" : function(key, stuff) { return null; },    "out": "my_collection" + "_keys" })  db[mr.result].distinct("_id")    my_collection は key を取得したい collection名に変更してください。  mr = db.runCommand({   "mapreduce" : " EFn ",   "map" : function() {     for (var key in this) { emit(key, null); }   },   "reduce" : function(key, stuff) { return null; },    "out": "my_collection" + "_keys" })   {     "result" : "my_collection_keys",     "timeMillis" : 290837,     "counts" : {      "input...
