title: create a new object Id in mongoDB using node js
body: <p>I am using the below code to insert data to mongodb</p>
  
  <pre><code>    router.post('/NewStory', function (req, res) {
  var currentObject = { user: userId , story : story , _id:new ObjectID().toHexString() };
          req.db.get('clnTemple').findAndModify({
              query: { _id: req.body.postId },
              update: { $addToSet: { Stories: currentObject } },
              upsert: true
          });
  });
  </code></pre>
  
  <p>This code is working fine if i remove the <code>_id:new ObjectID().toHexString()</code></p>
  
  <p>What i want to achieve here is that for every new story i want a unique <strong>_id</strong> object to be attached to it</p>
  
  <p>What am i doing wrong?</p>
  
  <pre><code>{
      "_id": {
          "$oid": "55ae24016fb73f6ac7c2d640"
      },
      "Name": "some name",
       ...... some other details
      "Stories": [
          {
              "userId": "105304831528398207103",
              "story": "some story"
          },
          {
              "userId": "105304831528398207103",
              "story": "some story"
          }
      ]
  }
  </code></pre>
  
  <p>This is the document model, the _id that i am trying to create is for the stories</p>