Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Looks like a couple of things:</p> <ol> <li><p>The connection URL should be mongo.onmodulus.net</p> <p>var mdbserver = new mdbServer('mongo.onmodulus.net', 27017, {auto_reconnect: true});</p></li> <li><p>rounce is correct, the database name is auto-generated by Modulus.</p> <p>var db = new mdbDb('3xam913', mdbserver, {safe: true});</p></li> <li><p>Modulus databases will need authentication. Before you call createCollection, you'll have to call auth and pass it the user credentials that are setup on the project dashboard.</p></li> </ol> <p>I'm a Modulus developer, and I know the DB name thing is not ideal.</p> <p>Edit: here's full source for a working example. It records every HTTP request and then sends all requests back to the user.</p> <pre><code>var express = require('express'), mongo = require('mongodb'), Server = mongo.Server, Db = mongo.Db; var app = express(); var server = new Server('mongo.onmodulus.net', 27017, { auto_reconnect: true }); var client = new Db('piri3niR', server, { w: 0 }); client.open(function(err, result) { client.authenticate('MyUser', 'MyPass', function(err, result) { if(!err) { console.log('Mongo Authenticated. Starting Server on port ' + (process.env.PORT || 8080)); app.listen(process.env.PORT || 8080); } else { console.log(err); } }); }); app.get('/*', function(req, res) { client.collection('hits', function(err, collection) { collection.save({ hit: req.url }); // Wait a second then print all hits. setTimeout(function() { collection.find(function(err, cursor) { cursor.toArray(function(err, results) { res.send(results); }); }); }, 1000) }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload