MongoDB best practice - array vs. new documents -


i have system users , competitions in mongodb. want users able sign competitions. best practice:

  • to have third collection named "competitionsignups" signups saved in separate documents - references both competition , user.

  • to have array in each competition document references users has signed it.

  • a third solution??

edit: primary operations are:

  • select competitions user signed for
  • select users in competition
  • select users signed given competition, , hasn't used account given time period. can unregistered competition. (the user documents has parameter named "last_use_date").


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

android - How to prevent keyboard from closing when bottom dialog is open? -