Saturday 28 March 2020

Mongoose - linking two collections

I am currently designing a system storing information about a users and their payment methods.I have a users and a paymentcard collection. Basically what I want to do is, when I a crate a new payment card record, I want to assign it to a user by including that users mongoID in the payment card document, and then be able to retrieve the user AND all payment cards associated with him by querying the db with the user’s mongoID. How can that be done?

Submitted March 28, 2020 at 07:56PM by Fizaraz

No comments:

Post a Comment