插入新增记录

举例:

insertResult = questionCollection.insert_one(newQuestion)
newQuestionIdObj = insertResult.inserted_id
log.debug("newQuestionIdObj=%s", newQuestionIdObj)

类似的用Postman通过API调用效果:

postman_insert_mongo_item

插入后的数据在MongoDB Compass的显示效果:

compass_inserted_item

results matching ""

    No results matching ""