In pymongo, dict is stored in the list. How to delete or update the dict according to the key-value value value?

  mongodb, question
{
    "title": "hello world",
    "comments": [
                    {"id": 1, "text": "text 1"},
                    {"id": 2, "text": "text 2"},
                    {"id": 3, "text": "text 3"}, 
                    ...
                ],
    "author": "",
    "views": 1000,
}

Let’s say I know a comment nowid=2, want to delete commentsid=2The dictionary, that is{"id": 2, "text": "text 2"}How should this data be written?

If it is an updateid=2ThetextThe content of the, and how to write?

This array locator can use mongodb. Details:
http://www.co-ding.com/? p=274