I have this in a collection:
"_id": "62be0271d373b2f2fc1826a2",
"condition": "new",
"variants": [
{
"color_name": "Green",
"items": [
{
"size": "S",
"price": 100,
"quantity": 1,
"_id": "62be0271d373b2f2fc1826a4"
},
{
"size": "M",
"price": 100,
"quantity": 2,
"_id": "62be0271d373b2f2fc1826a5"
}
],
"_id": "62be0271d373b2f2fc1826a3"
},
{
"color_name": "Blue",
"items": [
{
"size": "S",
"price": 100,
"quantity": 1,
"_id": "62be0271d373b2f2fc1826a7"
},
{
"size": "S",
"price": 100,
"quantity": 1,
"_id": "62be0271d373b2f2fc1826a8"
}
],
"_id": "62be0271d373b2f2fc1826a6"
}
],
"featured": true
I have this document in my mongodb collection:
"_id": "62be0271d373b2f2fc1826a2",
"condition": "new",
"variants": [
{
"color_name": "Green",
"items": [
{
"size": "S",
"price": 100,
"quantity": 1,
"_id": "62be0271d373b2f2fc1826a4"
},
{
"size": "M",
"price": 100,
"quantity": 2,
"_id": "62be0271d373b2f2fc1826a5"
}
],
"_id": "62be0271d373b2f2fc1826a3"
},
{
"color_name": "Blue",
"items": [
{
"size": "S",
"price": 100,
"quantity": 1,
"_id": "62be0271d373b2f2fc1826a7"
},
{
"size": "S",
"price": 100,
"quantity": 1,
"_id": "62be0271d373b2f2fc1826a8"
}
],
"_id": "62be0271d373b2f2fc1826a6"
}
],
"featured": true
I want to update only the quantity of the items field with _id = “62be0271d373b2f2fc1826a8”
NOTE: there may be more variants