title: Error when inserting a document into MongoDB via Node.js
body: <p>I'm trying to insert a document into MongoDB in Node.js. I have read from the DB successfully, and added documents via the command-line interface. However, I can't insert a document from JavaScript. If I do, I get an error:</p>
  
  <blockquote>
    <p>Error: Cannot use a writeConcern without a provided callback</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>var mongodb = require("mongodb");
  var MongoClient = mongodb.MongoClient;
  
  MongoClient.connect("mongodb://localhost:27017/test", function(err, db) {
          if (!err) {
              db.collection("test").insert({ str: "foobar" });
          }
      });
  </code></pre>
  
  <p>I can't for the life of me figure out why I get this error.</p>
  
  <p>What did I do wrong, and how should I do this instead?</p>