update nested array documents in mongodb
<p>I am new guy to mongodb and node.js. I have a one problem, I have a data's contain in mongodb has following structure. And i want to update id:11 &amp; name : John. </p>

<p>So <strong>first</strong> i have check name: john already present or not,   using  this coding</p>

<pre><code>collection.findOne({"team":testing, "detail.teamhead":"ramesh"},{"detail.colleagues.name":"vinay"},function(err,result)
{console.log(result)}
</code></pre>

<p>but it showed null, i tried via mongodb commandline , it also showed null. 
<strong>second</strong> i want to remove <code>id:11 &amp; name:John</code> , 
I searched from google, i can't found the solution and 
i don't know how to do that, so if anybody knows that please guide me</p>

<pre><code>{
        "team" : "testing",
        "detail" : [
            {
                "teamhead" : "ramesh",
                "colleagues" : [
                    {
                        "id" : 1,
                        "name" : "vinay",
                        "isread" : "false"
                    },
                    {
                        "id" : 2,
                        "name" : "John",
                        "isread" : "false"
                    }
                ]               
            },
            {
                "teamhead" : "arun",
                "colleagues" : [
                    {
                        "id" : 11,
                        "name" : "murali",
                        "isread" : "false"
                    },
                    {
                        "id" : 22,
                        "name" : "aswin",
                        "isread" : "false"
                    }
                ],          
            }
        ],
        "_id" : ObjectId("50093f83ea7a87e211000001")
    } 
</code></pre>
