First contact with nosql
There are some doubts about the table structure.
For example, design a game user list
Should the user’s backpack be included in the user’s table or built separately?
//user table user
{
_id: '',
name: '',
email: '',
....
backpack: [
{
//backpack 1
},
{
//backpack 2
}
]
}
//or
//user table user
{
_id: '',
name: '',
email: '',
...
}
//User Backpack Table
{
_id: '',
user_id: '',
...
}
Solve! Thank you!
This is a simple data problem, involving the database.
Personal suggestion is to establish separately and restrict association through foreign keys.