title: Cannot read property '_self' of undefined in DocumentDB
body: <p>I want to create a collection in DocumentDB by using Azure. I have a written a code but when executing it throws an error saying that "Cannot read property '_self' of undefined".
  Below is my code,can any one please do look into my code and help me out.</p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var DocumentClient = require("documentdb").DocumentClient;
  
  //the URI value from the DocumentDB Keys blade on http://portal.azure.com 
  
  var endpoint ="https://somedbname.documents.azure.com:443/";
  
  //the PRIMARY KEY value from the DocumentDB Keys blade on 
  
  http://portal.azure.com 
  
  var authkey = 
  
  "SomeAuthKey=="; 
  
  var client = new DocumentClient(endpoint,{"masterkey": authkey});
  
  var databaseDefinition = {"id": "documentdb1"};
  
  var collectionDefinition = {"id": "table1"};
  
  var documentDefinition = {
  
          "id": "pgogula",
  
          "stuff": "Hello World",
  
          "bibbidi": {
  
          "bobbidi": "boo"
  
          }
  };
  
  
  client.createDatabase(databaseDefinition, function(err,database){
  
  client.createCollection(database._self,collectionDefinition, 
  
  function(err,collection){
  
  client.createDocument(collection._self, documentDefinition, 
  
  function(err,document){
  
  client.queryDocuments(collection._self,"SELCT * FROM docs d WHERE 
  
  d.bibbidi.bobbidi='boo'").toArray(function(err, results){
  
   console.log("Query Results:");
  
   console.log(results);
  
   });
  
  });
  
  });
  
  });
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>D:\Node.js\azure\nodetest&gt;node app.js
  
  D:\Node.js\azure\nodetest\app.js:20
  
  client.createCollection(database._self,collectionDefinition, function(err,coll
                                  ^
  TypeError: Cannot read property '_self' of undefined
  
  at D:\Node.js\azure\nodetest\app.js:20:33
  
      at IncomingMessage.&lt;anonymous&gt; (D:\Node.js\azure\nodetest\node_modules\docum
  
  entdb\lib\request.js:49:14)
  
      at IncomingMessage.emit (events.js:129:20)
  
      at _stream_readable.js:908:16
  
      at process._tickCallback (node.js:355:11)
  </code></pre>