If I have a user schema with an inventory that contains multiple slots, how can I properly nest the slotimg and slottext fields inside the inventory field?
For instance, like this:
const UserSchema = new mongoose.Schema({
Inventory: {
slot1img: {
type: String,
},
slot1text: {
type: String,
},
slot2img: {
type: String,
},
slot2text: {
type: String,
},
slot3img: {
type: String,
},
},
});
When attempting to structure it this way, the information does not display in the database. How can I resolve this issue?