I want to do something as below:
db.coll.updateMany(
{},
{
$push:{
"newField":new ObjectId()
}
}
)
I want newField to have unique ids for all docs. But that's not the case as ObjectIds are generated on driver side.
How can I do this? MongoDB version is 4.2