Greetings, i have this database operation written in python using motor_asyncio
result = await collection.update_one({"ssid": ssid}, {
"$addToSet": {"routes": route},
"$setOnInsert": {"timestamps.added": datetime.utcnow()},
"$currentDate": {"timestamps.last_modified": {"$type": "date"}}
}, upsert=True)
the issue i have with this is that id like to also get $currentDate
in $setOnInsert
sadly doing "$setOnInsert": {"$currentDate": {"timestamps.added": True}}
doesn’t really work.
This works fine as it is but im storing two different server times when using datetime.utcnow()
I would be grateful for hints or help, i did look into the docs but didint really find a solution