Answer the question
In order to leave comments, you need to log in
What is the best way to organize a collection of data in mongose?
I'm just doing an online store. The store has a manager. He enters data about the goods. I don’t know how many goods there will be.
product:{
type: String,
required: true
}
product1: {
type: String //данные о заказе
},
quality1: {
type: Number //количество товара
},
product2:{
type: String
},
quality2: {
type: Number
},
order: {
order: "сапоги 1, кросовки 2" //и преобразовывать данные в одну строку
}
Answer the question
In order to leave comments, you need to log in
probably something like make each order an array of objects
order: [{
product: ObjectId,
quantity: Number
}]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question