title: MongoDB: Geospatial Index array not in correct format
body: <p>While trying to setup to use the Geospatial Index on MongoDB, I run into the error message that the location array is not in the correct format.</p>
  
  <p>This is my collection "test". </p>
  
  <pre><code>{
      "_id" : ObjectId("4f037ac176d6fdab5b00000a"),
      "CorporateId" : "XYZ12345",
      "Places" : [
             {
  
                     "Location" : {
                             "Longitude" : "50.0",
                             "Latitude" : "50.0"
                     },
                     "ValidFrom" : "2011-11-01 00:00:00",
                     "ValidTo" : "2021-12-31 00:00:00",
                     "itemCount" : "1"
             }
      ]
  }
  </code></pre>
  
  <p>Once I run this code. </p>
  
  <pre><code>db.test.ensureIndex({"Places.Location": "2d"});
  </code></pre>
  
  <p>I get this error message</p>
  
  <blockquote>
    <p>location object expected, location array not in correct format</p>
  </blockquote>
  
  <p>My assumption is that the Long/Lat needs to be a number.
  Currently it is an object.</p>
  
  <pre><code>typeof db.test.Places.Location.Longitude -&gt; Object
  typeof db.test.Places.Location -&gt; Object
  </code></pre>
  
  <p>My problem is that since I am still quite new to MongoDB, I don't really know how to approach this problem in the best way.</p>