i am trying to db.collection.find() i want to find document with docId:'sparksLog' and then find inside it 'alerts' then object2 which has a timestamp as highlighted in the image (1602579600000), and then update last field value ( valid: true) to (valid:false)
I am using pymongo, python3.8
{
"docId": "sparksLog",
"alerts": [{
"symbol": "ATOMUSDT",
"candleDate": {
"$date": "2020-10-13T03:30:00.000Z"
},
"spotDate": {
"$date": "2020-10-14T22:36:56.795Z"
},
"timeStamp": 1602559800000,
"alertPrice": 5.925,
"side": "buy",
"indicatorName": "Q1200",
"currentPrice": 5.925,
"changePercent": 0,
"accuracy": 59,
"forecast": 7.94,
"rating": 5.9,
"valid": true
}, {
"symbol": "ATOMUSDT",
"candleDate": {
"$date": "2020-10-13T09:00:00.000Z"
},
"spotDate": {
"$date": "2020-10-14T22:36:57.416Z"
},
"timeStamp": 1602579600000,
"alertPrice": 6.055,
"side": "sell",
"indicatorName": "Q140",
"currentPrice": 6.055,
"changePercent": 0,
"accuracy": 59,
"forecast": -3.25,
"rating": 5.9,
"valid": true
}]
}
