Hi,
very new to programming I’m not quite sure how to do this.
Because of the denormalization “required” for mongodb I have the following model:
var product= { name: "string", picture: "url", manufacturer: "string", price: { //should be array validFrom: "dateTime", validTo: "dateTime", added: "dateTime", current: "boolean", store: { //should be array id: "id of Store in collection", name: "string", geoLocation: "dontnowyet" } } }
I now would like to create a function, class, object… which i can call with the nested values so and then use the object insert it into mongodb.
What is the best way to do this? Do i need ES6 classes with extend?
Sorry for the late response.
I wanted to create an object (Product) which has a property price (also an object)
and another property store (also an object).
I wasn’t sure how on how to create them so to properly use them in Meteor.
Anyhow I now went for 3 separate objects/collections with references pointing on each other.