Optimization with Mongodb

Asked

Viewed 60 times

1

I’m starting with Mongodb and I have a question about optimization.

COLLECTION BOLAO:

[
campeonato : 'Brasil - Série A',
confrontos : [
{
  id : 10,
  casa : "Sport",
  visitante : "Chapecoense",
  horario : "2017-07-20 11:00:00"
}
]
]

BOOKIE COLLECTION: MODE 1 So I would use less data, but thinking a little relational

{
  nome : "wedson",
  apostas : [
   {
     idjogo : 10,
     opcao : 1,
     valores : 1
   }
  ]
}

COLLECTION PLAYER MODE 2 So it would use the concept of embedded documents, but the larger serious data load

{
  nome : "wedson",
  apostas : [
   {
      id : 10,
     casa : "Sport",
     visitante : "Chapecoense",
     horario : "2017-07-20 11:00:00"
     idjogo : 10,
     opcao : 1,
     valores : 1
   }
  ]
}

the doubt is to use mode 1 where or mode 2, I did not want to start a project without knowing these small details already thank you. :)

  • It’s a different model, but I answered a similar question here. I think it’s worth reading!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.