Answer the question
In order to leave comments, you need to log in
MongoDB, how to create a db object by variable value?
There is an object in the database, which can potentially contain up to one and a half hundred objects. I would like each object to be named, like this:
For this example, the names of the objects are hard-coded in the code:
How to make the named object created by the value that is in the variable? The code doesn't seem to work. `object.${id}`: {}
object[id]: {}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question