I am in the process of migrating a database from Firebase to MongoDB and am facing a problem. Here is such an object I have stored in the FB:
"logs": {
"2021-05-24": {
"124109": {
"foo": "text",
"bar": "text"
}
}
}
When I import it into Mongo (through the Mongo compass as a JSON object) it is inserted in this form:
"logs": {
"2021-05-24": [
null,
null,
... # overall 124109 nulls here
null,
{
"foo": "text",
"bar": "text"
}
]
}
As I can see, it reads the key of the nested object as the number of real array objects. How can I correctly migrate an object of this type in mongo?
"124109": { ... }
, but after importing to mongo it transforming into array[ ]
, my question is how to fix it