Answer the question
In order to leave comments, you need to log in
Data modeling in Mongodb?
Help me decide when creating a data model!
There are Groups of Students and N Tests.
Here is the first model when displaying the log of test results
, we also need to pull the necessary information from 2 collections (group and tests).
group{
groups:{
users:{
user1{a,b,c,...}
user2{a,b,c,...}
....
}
}
tests{
name,
questions:{
question1{a,b,c,...}
question2{a,b,c,...}
...
}
}
logs{
user.id,
test.id,
date,
result
}
groups:{
users:{
user1{a,b,c,...}
user2{a,b,c,...}
....
}
}
tests{
name,
questions:{
question1{a,b,c,...}
question2{a,b,c,...}
...
}
}
logs{
user{
Name,
Yaer,
...
},
test{
Name,
...
}
date,
result
}
Answer the question
In order to leave comments, you need to log in
BUT if any user or test data changes, all affected documents will need to be updated.now you understand the beauty of schemaless.
BUT if any user or test data changes, all affected documents will need to be updated.Because you are using a NoSQL database for relational data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question