node.js に MongoDB ドライバーを使用して、コレクションのリストを取得しようとしています。これは、データを取得するための適切な第一歩だと思います。
Ruby経由で正常に追加したコレクションとデータがすでにあります。ドキュメントによると、私のコードは動作するはずです。
(function() {
var client, db, listAllData, server;
db = require('mongodb').Db;
server = require('mongodb').Server;
client = new db('images', new server('something.mongolab.com', 111111, {
username: 'username',
password: 'password'
}));
client.open(function(err, the_client) {
the_client.collectionNames(function(err, colls) {
console.log(colls);
});
});
}).call(this);
基本的な何かが欠けているように感じます。