需要更新Mongodb用户并在更新旧密码后也正常工作

I have used the below Code for update the mongo DB user password. But old and new updated both password was working that should support new password only.

while($getRows=$numrows->fetch())
{
    $mongo = new MongoClient("mongodb://localhost", array(
        "username" => $nodeuser, 
        "password" => $nodepwd
    ));

    $db = $mongo->$getRows['my_name_vc'];
    $command = array (
        "updateUser" => $getRows['mu_name_vc'],
        "pwd"        => $password
    );

    $doc=$db->command( $command );   
}

If we have restart the mongoDB new password only taken. Let us know any queries to run ?