1
1
1programmer2018-11-02 14:13:45
Node.js
1programmer, 2018-11-02 14:13:45

How to form and get value from mongoose database?

Greetings.
Such a task: There is a select, it contains the id of the city and its name

<select class="custom-select" name="city_id">
                                <option value="1" name="city">Москва</option>
                                <option value="2" name="city">Санкт-Петербург</option>
                        </select>

It is necessary to enter the value of the id of the city and its name into the database.
It turns out that you need to form 2 tables with one with cities, and get it from the other?
How do I organize the base and how do I get the result?

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