title: Mongoimport import json array as collection not as key in collection
body: <p>I am attempting to seed a database with a json array of data with mongoimport, however when the data reaches the mongo collection, it imports as a key in the collection object like this:</p>
  <p>&quot;items&quot; is my json file, it always shows up as &quot;items&quot;, I want the parent array to be the array I'm trying to import itself, does this make sense?</p>
  <p><strong>Update</strong></p>
  <p>Please see this example, the first image is how mongoimport is importing this array of objects:</p>
  <pre><code>{ &quot;_id&quot; : ObjectId(&quot;58dc01ecec116d4c9039e47c&quot;), &quot;items&quot; : [ { &quot;id&quot; : 1, &quot;_id&quot; : &quot;item1&quot;, &quot;type&quot; : &quot;alert&quot;, &quot;title&quot; : &quot;hello.world&quot;, &quot;email&quot; : &quot;something@something.com&quot;, &quot;message&quot; : &quot;&quot;, &quot;createdDate&quot; : &quot;date&quot;, &quot;price&quot; : &quot;$9.00&quot;, &quot;active&quot; : true }, { &quot;id&quot; : 2, &quot;_id&quot; : &quot;item2&quot;, &quot;type&quot; : &quot;welcome.lol&quot;, &quot;title&quot; : &quot;Item 2&quot;, &quot;email&quot; : &quot;something@something.com&quot;, &quot;message&quot; : &quot;lol&quot;, &quot;createdDate&quot; : &quot;date&quot;, &quot;price&quot; : &quot;$12.00&quot;, &quot;active&quot; : true }, { &quot;id&quot; : 3, &quot;_id&quot; : &quot;item3&quot;, &quot;type&quot; : &quot;message&quot;, &quot;title&quot; : &quot;various.domain&quot;, &quot;email&quot; : &quot;something@something.com&quot;, &quot;message&quot; : &quot;lol&quot;, &quot;createdDate&quot; : &quot;date&quot;, &quot;price&quot; : &quot;$3.00&quot;, &quot;active&quot; : false }, { &quot;id&quot; : 4, &quot;_id&quot; : &quot;item4&quot;, &quot;type&quot; : &quot;message&quot;, &quot;title&quot; : &quot;something.else&quot;, &quot;message&quot; : &quot;&quot;, &quot;createdDate&quot; : &quot;date&quot;, &quot;price&quot; : &quot;$12.00&quot;, &quot;active&quot; : false }, { &quot;id&quot; : 5, &quot;_id&quot; : &quot;item5&quot;, &quot;type&quot; : &quot;update&quot;, &quot;title&quot; : &quot;wow.lol&quot;, &quot;email&quot; : &quot;something@something.com&quot;, &quot;message&quot; : &quot;&quot;, &quot;createdDate&quot; : &quot;date&quot;, &quot;price&quot; : &quot;$12.00&quot;, &quot;active&quot; : false }, { &quot;id&quot; : 6, &quot;_id&quot; : &quot;item6&quot;, &quot;type&quot; : &quot;update&quot;, &quot;title&quot; : &quot;domainname.net&quot;, &quot;email&quot; : &quot;something@something.com&quot;, &quot;message&quot; : &quot;cars&quot;, &quot;createdDate&quot; : &quot;date&quot;, &quot;price&quot; : &quot;$12.00&quot;, &quot;active&quot; : false }, { &quot;id&quot; : 7, &quot;_id&quot; : &quot;item7&quot;, &quot;type&quot; : &quot;update&quot;, &quot;title&quot; : &quot;something.lol&quot;, &quot;email&quot; : &quot;something@something.com&quot;, &quot;message&quot; : &quot;&quot;, &quot;createdDate&quot; : &quot;date&quot;, &quot;price&quot; : &quot;$12.00&quot;, &quot;active&quot; : false } ] }
  </code></pre>
  <p>Notice how its treats the entire array as an &quot;item&quot; object, with a key in the item &quot;items&quot; which is the array, I want the data to look like this:</p>
  <pre><code>{ &quot;_id&quot; : ObjectId(&quot;58dc027a2c74df002a957281&quot;), &quot;price&quot; : &quot;asdf&quot;, &quot;message&quot; : &quot;asdf&quot;, &quot;email&quot; : &quot;aasfd&quot;, &quot;title&quot; : &quot;asdf&quot;, &quot;dateCreated&quot; : ISODate(&quot;2017-03-29T18:52:42.227Z&quot;), &quot;active&quot; : true, &quot;__v&quot; : 0 }
  { &quot;_id&quot; : ObjectId(&quot;58dc027b2c74df002a957282&quot;), &quot;price&quot; : &quot;asdf&quot;, &quot;message&quot; : &quot;asdf&quot;, &quot;email&quot; : &quot;aasfd&quot;, &quot;title&quot; : &quot;asdf&quot;, &quot;dateCreated&quot; : ISODate(&quot;2017-03-29T18:52:43.574Z&quot;), &quot;active&quot; : true, &quot;__v&quot; : 0 }
  { &quot;_id&quot; : ObjectId(&quot;58dc027b2c74df002a957283&quot;), &quot;price&quot; : &quot;asdf&quot;, &quot;message&quot; : &quot;asdf&quot;, &quot;email&quot; : &quot;aasfd&quot;, &quot;title&quot; : &quot;asdf&quot;, &quot;dateCreated&quot; : ISODate(&quot;2017-03-29T18:52:43.708Z&quot;), &quot;active&quot; : true, &quot;__v&quot; : 0 }
  { &quot;_id&quot; : ObjectId(&quot;58dc027b2c74df002a957284&quot;), &quot;price&quot; : &quot;asdf&quot;, &quot;message&quot; : &quot;asdf&quot;, &quot;email&quot; : &quot;aasfd&quot;, &quot;title&quot; : &quot;asdf&quot;, &quot;dateCreated&quot; : ISODate(&quot;2017-03-29T18:52:43.855Z&quot;), &quot;active&quot; : true, &quot;__v&quot; : 0 }
  { &quot;_id&quot; : ObjectId(&quot;58dc027b2c74df002a957285&quot;), &quot;price&quot; : &quot;asdf&quot;, &quot;message&quot; : &quot;asdf&quot;, &quot;email&quot; : &quot;aasfd&quot;, &quot;title&quot; : &quot;asdf&quot;, &quot;dateCreated&quot; : ISODate(&quot;2017-03-29T18:52:43.994Z&quot;), &quot;active&quot; : true, &quot;__v&quot; : 0 }
  { &quot;_id&quot; : ObjectId(&quot;58dc027c2c74df002a957286&quot;), &quot;price&quot; : &quot;asdf&quot;, &quot;message&quot; : &quot;asdf&quot;, &quot;email&quot; : &quot;aasfd&quot;, &quot;title&quot; : &quot;asdf&quot;, &quot;dateCreated&quot; : ISODate(&quot;2017-03-29T18:52:44.128Z&quot;), &quot;active&quot; : true, &quot;__v&quot; : 0 }
  { &quot;_id&quot; : ObjectId(&quot;58dc027c2c74df002a957287&quot;), &quot;price&quot; : &quot;asdf&quot;, &quot;message&quot; : &quot;asdf&quot;, &quot;email&quot; : &quot;aasfd&quot;, &quot;title&quot; : &quot;asdf&quot;, &quot;dateCreated&quot; : ISODate(&quot;2017-03-29T18:52:44.263Z&quot;), &quot;active&quot; : true, &quot;__v&quot; : 0 }
  { &quot;_id&quot; : ObjectId(&quot;58dc027c2c74df002a957288&quot;), &quot;price&quot; : &quot;asdf&quot;, &quot;message&quot; : &quot;asdf&quot;, &quot;email&quot; : &quot;aasfd&quot;, &quot;title&quot; : &quot;asdf&quot;, &quot;dateCreated&quot; : ISODate(&quot;2017-03-29T18:52:44.391Z&quot;), &quot;active&quot; : true, &quot;__v&quot; : 0 }
  </code></pre>
  <p>Where each item in the array is created as an &quot;item&quot; in mongo, each with its own ObjectID - otherwise it's useless for CRUD applications.</p>
  <p>Docker MongoDB Log:</p>
  <pre><code>mongodb_1       | 2017-03-29T21:38:09.439+0000 I COMMAND  [conn1] command reach-engine.domains command: insert { insert: &quot;domains&quot;, documents: [ { items: [ { id: 1, _id: &quot;item1&quot;, type: &quot;alert&quot;, title: &quot;hello.world&quot;, email: &quot;something@something.com&quot;, message: &quot;&quot;, createdDate: &quot;date&quot;, price: &quot;$9.00&quot;, active: true }, { id: 2, _id: &quot;item2&quot;, type: &quot;welcome.lol&quot;, title: &quot;Item 2&quot;, email: &quot;something@something.com&quot;, message: &quot;lol&quot;, createdDate: &quot;date&quot;, price: &quot;$12.00&quot;, active: true }, { id: 3, _id: &quot;item3&quot;, type: &quot;message&quot;, title: &quot;various.domain&quot;, email: &quot;something@something.com&quot;, message: &quot;lol&quot;, createdDate: &quot;date&quot;, price: &quot;$3.00&quot;, active: false }, { id: 4, _id: &quot;item4&quot;, type: &quot;message&quot;, title: &quot;something.else&quot;, message: &quot;&quot;, createdDate: &quot;date&quot;, price: &quot;$12.00&quot;, active: false }, { id: 5, _id: &quot;item5&quot;, type: &quot;update&quot;, title: &quot;wow.lol&quot;, email: &quot;something@something.com&quot;, message: &quot;&quot;, createdDate: &quot;date&quot;, price: &quot;$12.00&quot;, active: false }, { id: 6, _id: &quot;item6&quot;, type: &quot;update&quot;, title: &quot;domainname.net&quot;, email: &quot;something@something.com&quot;, message: &quot;cars&quot;, createdDate: &quot;date&quot;, price: &quot;$12.00&quot;, active: false }, { id: 7, _id: &quot;item7&quot;, type: &quot;update&quot;, title: &quot;something.lol&quot;, email: &quot;something@something.com&quot;, message: &quot;&quot;, createdDate: &quot;date&quot;, price: &quot;$12.00&quot;, active: false } ] } ], writeConcern: { getLastError: 1, w: 1 }, ordered: false } ninserted:1 keyUpdates:0 writeConflicts:0 numYields:0 reslen:40 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, Database: { acquireCount: { w: 1, W: 1 } }, Collection: { acquireCount: { W: 1 } } } protocol:op_query 250ms
  </code></pre>