I have a large set of JSON docs which I am willing to store in a MongoDB.
However, given I am searching and retrieving only against few fields, I was wondering from performance-wise which way it would be better.
One option is to store the large object as JSON/BSON so the doc will look like:
{
"key_1": "Value1",
"key_2": "Value2",
"external_data": {
"large": {
"data": [
"comes",
"here"
]
}
}
}
Or alternatively,
{
"key_1": "Value1",
"key_2": "Value2",
"external_data": '{"large":{"data":["comes","here"]}}'
}