i want to update my all MongoDB doc who contain ObjectId in my nested array object
my doc is:
{
"_id" : ObjectId("5a61a6bdae8bdc26685f8c27"),
"variant_count" : 1,
"salts" : [
{
"name" : "Cetirizine",
"classification" : "HD",
"dosage" : 0.0,
"is_cold_storage" : false,
"id" : ObjectId("5a61a292ae8bdc26685f2a91")
}]
"drug_category" : "DRUGS",
"name" : "Adicold Tab",
}
i want to update all salts.id as a string,
for eg.
{
"_id" : ObjectId("5a61a6bdae8bdc26685f8c27"),
"variant_count" : 1,
"salts" : [
{
"name" : "Cetirizine",
"classification" : "HD",
"dosage" : 0.0,
"is_cold_storage" : false,
"id" : "5a61a292ae8bdc26685f2a91"
}]
"drug_category" : "DRUGS",
"name" : "Adicold Tab",
}