A
A
Abc Edc2015-05-10 13:57:45
MongoDB
Abc Edc, 2015-05-10 13:57:45

How will such a moment look like in api?

I want to add a person to a group (in mongo), i.e. assign a person to an array of groups of idgroups and add the reverse id of a person to an array of people in a group, so in api this is how to correctly reflect

/user/:id/addGroup/:id
или
/group/:id/addUser/:id

and will it be true
app.post('запрос', userController.addGroup,groupController.addUser);

Divide it into two nexts, otherwise it’s not right if I use the Group model from the UserController

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cybervito21, 2015-05-14
@gleber1

POST /groups/:id/users

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question