pipe = [{'$match': {'_id': str(coin)}}, {'$unwind': '$TRANSACTION'}, {
    '$group': {'_id': '$_id', 'last_transaction_date': {'$max':
    '$TRANSACTION.DATE'}}}]
cursor = self.collection.aggregate(pipeline=pipe)
docs = list(cursor)
self.collection.update_one({'_id': docs[0]['_id']}, {'$pull': {
    'TRANSACTION': {'DATE': docs[0]['LAST_TRANSACTION_DATE']}}})
How Iterate or remove MongoDb array list item using pymongo?