from rocket.mongodb import users_collection
users_collection.update_one({'uniqueId': 'abcdef9999'},
{'$addToSet': {'numbers': {'$each': [{"value": 10, "date": "2021-01-01"},
{"value": 11, "date": "2021-01-01"},
{"value": 12, "date": "2021-02-01"}
]}}},
upsert=True)
我想插入唯一的date,如果value不同也只存一份,如何实现?