title: MongoDB system.profile collection: no data for "insert" operations?
body: <p>I've configured my MongoDB 2.0.2 instance (update: also tried this with a v2.2.0 instance) to log all operations to the <code>system.profile</code> collection (i.e., <code>db.setProfilingLevel(2)</code>) and am trying to see exactly what data is being inserted by an application when it calls save() for a <strong>new</strong> doc.</p>
  
  <p><em>I can see the 'insert' operations in the <code>system.profile</code> collection, but it doesn't include the data that's being inserted. Why is that?</em></p>
  
  <p>In contrast, update operations recorded in <code>system.profile</code> have an 'updateobj' property which shows the data.</p>
  
  <p>Here's an example from a 2.2.0 instance. As you can see, the profile log includes an entry for the update with 'updateObj' data. The insert, however, doesn't have any info about what was inserted.</p>
  
  <pre><code>&gt; use test;
  switched to db test
  &gt; db.getProfilingStatus();
  { "was" : 2, "slowms" : 100 }
  &gt; show collections;
  cartoons
  system.indexes
  system.profile
  &gt; db.foobar.insert({ "blah": true });
  &gt; db.foobar.update({ "blah": true }, { $set: { blerg: 1 } });
  &gt; db.system.profile.find({ ns:"test.foobar" });
  {
    "ts": ISODate("2012-09-25T20:37:40.287Z"),
    "op": "insert",
    "ns": "test.foobar",
    "keyUpdates": 0,
    "numYield": 0,
    "lockStats": {
      "timeLockedMicros": {
        "r": NumberLong(0),
        "w": NumberLong(2028)
      },
      "timeAcquiringMicros": {
        "r": NumberLong(0),
        "w": NumberLong(10)
      }
    },
    "millis": 2,
    "client": "127.0.0.1",
    "user": ""
  }{
    "ts": ISODate("2012-09-25T20:38:11.454Z"),
    "op": "update",
    "ns": "test.foobar",
    "query": {
      "blah": true
    },
    "updateobj": {
      "$set": {
        "blerg": 1
      }
    },
    "nscanned": 1,
    "moved": true,
    "nmoved": 1,
    "nupdated": 1,
    "keyUpdates": 0,
    "numYield": 0,
    "lockStats": {
      "timeLockedMicros": {
        "r": NumberLong(0),
        "w": NumberLong(1797)
      },
      "timeAcquiringMicros": {
        "r": NumberLong(0),
        "w": NumberLong(9)
      }
    },
    "millis": 1,
    "client": "127.0.0.1",
    "user": ""
  }
  </code></pre>