от пример одного из моих массивов
"menus": [{
"photos": [
{
"thumbnail": {
"path": "
https://lorempixel.com/320/240/?26742",
"width": 320,
"height": 240
},
"cover": {
"path": "
https://lorempixel.com/320/240/?17429",
"width": 320,
"height": 240
},
"standard": {
"path": "
https://lorempixel.com/320/240/?91126",
"width": 320,
"height": 240
},
"original": {
"path": "
https://lorempixel.com/320/240/?81771",
"width": 320,
"height": 240
},
"createdAt": 180952081,
"id": "5e1b42ec8a65aa00463990b2"
},
{
"thumbnail": {
"path": "
https://lorempixel.com/320/240/?38353",
"width": 320,
"height": 240
},
"cover": {
"path": "
https://lorempixel.com/320/240/?89679",
"width": 320,
"height": 240
},
"standard": {
"path": "
https://lorempixel.com/320/240/?77419",
"width": 320,
"height": 240
},
"original": {
"path": "
https://lorempixel.com/320/240/?13259",
"width": 320,
"height": 240
},
"createdAt": 1356172217,
"id": "5e1b42ec8a65aa00463990b7"
},
{
"thumbnail": {
"path": "
https://lorempixel.com/320/240/?53644",
"width": 320,
"height": 240
},
"cover": {
"path": "
https://lorempixel.com/320/240/?15455",
"width": 320,
"height": 240
},
"standard": {
"path": "
https://lorempixel.com/320/240/?48409",
"width": 320,
"height": 240
},
"original": {
"path": "
https://lorempixel.com/320/240/?48492",
"width": 320,
"height": 240
},
"createdAt": 787377832,
"id": "5e1b42ec8a65aa00463990bc"
},
{
"thumbnail": {
"path": "
https://lorempixel.com/320/240/?71655",
"width": 320,
"height": 240
},
"cover": {
"path": "
https://lorempixel.com/320/240/?45747",
"width": 320,
"height": 240
},
"standard": {
"path": "
https://lorempixel.com/320/240/?56219",
"width": 320,
"height": 240
},
"original": {
"path": "
https://lorempixel.com/320/240/?96956",
"width": 320,
"height": 240
},
"createdAt": 50395123,
"id": "5e1b42ec8a65aa00463990c1"
}
],
"title": "Ex excepturi soluta corrupti rem.",
"photosCount": 4,
"id": "5e1b42ec8a65aa00463990b1"
}]
Вот массивы ключей что нужны и массив замены ключей
$imageSetsRequiredFields = ['id', 'title', 'photos', 'photosCount'];
$galleryRequiredFields = ['id', 'standard', 'thumbnail', 'original', 'cover'];
$photoRequiredFields = ['path', 'width', 'height'];
$queryParamToMongo = ['id' => '_id',
'title' => 'name',
'photosCount' => 'imageCount',
'photos' => 'imageSet',
'path' => 'url',
];