Location-based array modification in mongodb

  mongodb, question
**>db.blog.findOne()
 {    "_id":"djsofjwo"
 "comments":[
 {
 "comment":"good post",
 "author":"john"
 "vote":0}
 
 {
 "comment":"I thought it is too short"
 "author":"bob"
 "vote":3
 }
 
 {
 "comment":"good"
 "author":"light"
 "vote":1
 }
 ]
 }
 >db.blog.update({"post":post_id},{"$inc":{"comments.0.vote":1}})

This is a revision of comments with position 0 in comments array in the shell environment, adding one to the vote. How to use python code to achieve the same function under pymongo?**

//you can use update_one
 from pymongo import MongoClient
 client = MongoClient()
 db = client.test
 result=db.restaurants.update_one({"post":post_id},{"$inc":{"comments.0.vote":1}})