title: MongoDB WinningPlan IDHACK
body: <p>For the below query:</p>
  
  <pre><code>db.restaurants.find({"_id" : ObjectId("5aabce4f827d70999ae5f5f7")}).explain()
  </code></pre>
  
  <p>I'm getting the below query plan:</p>
  
  <pre><code>/* 1 */
  {
  "queryPlanner" : {
      "plannerVersion" : 1,
      "namespace" : "test.restaurants",
      "indexFilterSet" : false,
      "parsedQuery" : {
          "_id" : {
              "$eq" : ObjectId("5aabce4f827d70999ae5f5f7")
          }
      },
      "winningPlan" : {
          "stage" : "IDHACK"
      },
      "rejectedPlans" : []
  },
  "serverInfo" : {
      "host" : "CHNMCT136701L",
      "port" : 27017,
      "version" : "3.6.3",
      "gitVersion" : "9586e557d54ef70f9ca4b43c26892cd55257e1a5"
  },
  "ok" : 1.0
  }
  </code></pre>
  
  <p>Now I have some questions on my mind. 
  What is meant by <code>stage: IDHACK</code> ? How its different from COLLSCAN? Whether this has anything to do with performance optimization? If yes, what are the scenarios in which MongoDB goes for this <code>winningplan</code> ? If I create an index on <code>_id</code>, whether <code>IDHACK</code> will be replaced by the respective indexing plan?
  Can anybody clarify this? </p>