In mongoDB collection I have different field types. Is it possible update doc in this collection with update_one method?
doc = {"upd_time": datetime.datetime.now(), "categories": [1,2,3]}
mng_collection.update_one({"_id": id}, {"$set": doc}, upsert=True)
That code replace existing array in categories field, but I need to add values from doc["categories"] array if not existing in collection doc array.