user_id= user["_id"]
string_user_id = str(agent_id)
Again convert it to ObjectId
from bson import ObjectId
ObjectId(string_user_id )