title: Nedb Multiple Collection Single Datastore
body: <p>I am a new to nedb. Its a kinda what sqlite is for sql community but for the node.js community.
  [<a href="https://github.com/louischatriot/nedb%5d" rel="nofollow">https://github.com/louischatriot/nedb]</a></p>
  
  <p>I wanted to ask is possible to have multiple collections in a single database file (datastore).
  If there is, could please show me some code sample on how to go about it?
  I have tried this:</p>
  
  <pre><code>var Datastore = require('nedb'),
      databaseURL="tudls.db",
      db = new Datastore({filename: databaseURL, autoload: true});
  </code></pre>
  
  <p>This creates a single datastore called db.
  From the documentation, I saw that nedb is mongo-like. So to insert a record I tried this:</p>
  
  <pre><code> app.post('/todos', function(req, res){
          var task = req.body.text;
          db.todols.insert({text: task, done: false}, function(err, saved){
              if(err||!saved){
                  res.send("Task not saved...");
              }
              res.send("Task saved...");});
      });
  </code></pre>
  
  <p>However, I get a 'cannot call method insert of undefined.' I thought that if I call the collection name (todols) when inserting a record it would work so that I can proceed to add another collection to the datastore (db.user) but I was mistaken. </p>
  
  <p>Hence, is it possible to have multiple collections in a single datastore or am I to have a datastore for each collection? If it is possible, does anyone know how to achieve this?
  Thank you...</p>