I'm working on this project where I have to perform mass insertion on MongoDB database
I understand that MongoDB is a document database and there is limit on size of each document as seen here
Now for mass insertion code look like this
RockBand.collection.insert(mass_data)
mass_data
is a array hash of like this
[
{
name: "LedZepplin",
member : 4,
studio_album : 10,
...
...
...
},
{
name: "Linkin Park",
member: 5,
studio_album: 7,
...
...
...
},
{
...
...
},
...
...
]
the total length of the array is 500K - 100K
an I knew for sure none of the above hash present in array which are basically a document in MongoDB are of size 16MB
So whenever I performer this
RockBand.collection.insert(mass_data)
Why it keeping give me 16MB limit error as state above I'm quite sure that none of the above document persent in the array(i.e hash) does not weigh is of 16MB individual .
then why the error of data-size exceed for a document
Is it considering the whole array as single document when it should have be considering
each hash of the array as an individual document
Can Anyone Suggest
Btw I'm using Mongoid Driver on top of MongoDB ruby driver for connecting to MongoDB