E
E
ExactlyDude2021-02-04 08:39:27
MongoDB
ExactlyDude, 2021-02-04 08:39:27

How to form the correct schema for mongoose?

How to form the correct schema for such data with nesting?

"Россия": {
        "Московская область": {
            "Москва": {
                "phone" : "+7000 000 00 00",
                "coord" : [54.564564, 78.5745464],
                "offices": [
                    {
                        "type": "Точка",
                        "adress": "ул. Пушкино",
                        "schedule": "without",
                        "phones": ["+7000 000 00 00", "+7111 222 33 44"]
                    }
                ]
            }
        },
        "Ростовская область": {
            "Ростов-на-Дону": {
                "phone" : "+7000 000 00 00",
                "coord" : [54.564564, 78.5745464],
                "offices": [
                    {
                        "type": "Точка",
                        "adress": "ул. Пушкино",
                        "schedule": "without",
                        "phones": ["+7000 000 00 00", "+7111 222 33 44"]
                    }
                ]
            }
        }
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question