D
D
DeniSidorenko2021-04-06 08:52:29
MongoDB
DeniSidorenko, 2021-04-06 08:52:29

How to make a request by id for 5 elements at once?

Good afternoon, there is a restaurant object where in the kinds field I specify Id which refers to the kinds collection
Based on the fact that I know the ID and the collection, I can get the object itself by Id , but I have an array of IDs. Based on this, I need to send a request several times, with a different ID and write the values ​​\u200b\u200bin the state. Considering that one restaurant can have at least 20-30 categories, making 20-30 requests only to get information about the category is not entirely correct. What way in this case it is possible to use what to be limited to only one request?
danu.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur, 2021-04-06
@cloudz

you should have an api method accepting an array of id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question