P
P
philatov1822019-10-22 09:47:28
MongoDB
philatov182, 2019-10-22 09:47:28

Is this design suitable in mongodb?

5daea468299c7962228831.png
There is such a database in a relational form. I'm trying to bring it to the mongodb format. Tell me how best to design such a database in mongo. I don’t understand how to properly store grades in a student’s discipline?
I got it like this:

student
{
      _id: ..,
      lname: ..,
      fname: ..,
      mname: ..,
      passport: { num: .., seria: ..},
      attests: [
             { discname: .., mark: ..},
             { .. }, ..
      ]
}

group
{
      _id: ..,
      num: ..,
      students: [
             ObjectId(..), ..
      ],
      disciplines: [
             ObjectId(..), ..
      ],
}

discipline
{
      _id: ..,
      name: ..,
      groups: [
             ObjectId(..), ..
      ],
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Frozen Coder, 2019-10-22
@frozen_coder

It all depends on how this data will be used.
If the user is important to us in the first place, then everything can be stuffed into it.
Transferring the scheme one to one is such an occupation. What problem are you solving with this? If relationships between entities are important to you and you want to use them from all sides, then maybe not eat a cactus and take a relational database?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question