Here is the data from Mongodb.
[
{
'_id': ObjectId('5ae348f19268ff41a8e35170'),
'commission': [
{'_id': ObjectId('5ae348f19268ff41a8e35170'),
'commission': [
{'_id': ObjectId('5ae21c969268ff4118df7f8a'), 'market': 'amazon_my', 'commission': 4.0, 'commission_vat': 0.24, 'payment': 2},
{'_id': ObjectId('5ae21c969268ff4118df7f8b'), 'market': 'amazon_sg', 'commission': 4.0, 'commission_vat': 0.24, 'payment': 2}
]
}
]
}
]
I would like to find, insert, delete, or update some of the data I want other than the whole data change. I've looked for several things, but I don't know how to do it effectively. Please help :)
____1. insert_data____
[
{
'_id': ObjectId('5ae348f19268ff41a8e35170'),
'commission': [
{'_id': ObjectId('5ae348f19268ff41a8e35170'),
'commission': [
{'_id': ObjectId('5ae21c969268ff4118df7f8a'), 'market': 'amazon_my', 'commission': 4.0, 'commission_vat': 0.24, 'payment': 2},
{'_id': ObjectId('5ae21c969268ff4118df7f8b'), 'market': 'amazon_sg', 'commission': 4.0, 'commission_vat': 0.24, 'payment': 2},
---inserted data {'_id': ObjectId('cae21c969268ff4118df7f8b'), 'market': 'amazon_th', 'commission': 4.0, 'commission_vat': 0.24, 'payment': 2}
]
}
]
}
]
____2. update_data____
[
{
'_id': ObjectId('5ae348f19268ff41a8e35170'),
'commission': [
{'_id': ObjectId('5ae348f19268ff41a8e35170'),
'commission': [
{'_id': ObjectId('5ae21c969268ff4118df7f8a'), 'market': 'amazon_my', 'commission': 4.0, 'commission_vat': 0.24, 'payment': 2},
{'_id': ObjectId('5ae21c969268ff4118df7f8b'), 'market': 'amazon_sg', 'commission': 4.0, 'commission_vat': 0.24, 'payment': 2},
___updated_commision {'_id': ObjectId('cae21c969268ff4118df7f8b'), 'market': 'amazon_th', 'commission': 88.0, 'commission_vat': 0.24, 'payment': 2}
]
}
]
}
]
____3. delete_data____
[
{
'_id': ObjectId('5ae348f19268ff41a8e35170'),
'commission': [
{'_id': ObjectId('5ae348f19268ff41a8e35170'),
'commission': [
{'_id': ObjectId('5ae21c969268ff4118df7f8a'), 'market': 'amazon_my', 'commission': 4.0, 'commission_vat': 0.24, 'payment': 2},
]
}
]
}
]
Thanks for reading:)