title: Mongorestore: createIndex error: Values in v:2 index key pattern cannot be of type object. Only numbers > 0, numbers < 0, and strings are allowed
body: <p>I receive the following error when running <code>mongorestore</code> command with a large MongoDB database.</p>
  
  <p>the machine where the backup was done:</p>
  
  <pre><code>db version v4.2.0
  git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
  OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
  allocator: tcmalloc
  modules: none
  build environment:
      distmod: ubuntu1804
      distarch: x86_64
      target_arch: x86_64
  </code></pre>
  
  <p>local machine version (where I execute <code>mongorestore</code>)</p>
  
  <pre><code>db version v4.0.10
  git version: c389e7f69f637f7a1ac3cc9fae843b635f20b766
  allocator: system
  modules: none
  build environment:
      distarch: x86_64
      target_arch: x86_64
  </code></pre>
  
  <p>Failed: prod.DeviceState: error creating indexes for prod.DeviceState: createIndex error: Values in v:2 index key pattern cannot be of type object. Only numbers > 0, numbers &lt; 0, and strings are allowed.</p>
  
  <p>Any help to solve this issue?</p>
  
  <p>Thank you</p>