I want to change the field value
type from string to object.
...{value: "my title"}... ===> ...{value:{value:"my title ABC"}}
In the Mongo shell, I present this field through the JavaScript var articlePath
. Now, how can I use this var to update the field value?
The following code is create a new field articlePath
instead of using the var's value.
var articlePath = "layout.content.header." + i + "." + j + ".value"
var articleValue = block.value + " ABC"
db.mycollection.update(
{_id: catId},
{
$set: {
articlePath: {value: articleValue}
}
},
function(err, numberUpdated) {
print("--->err: ", err)
}
)