MongoError : selector must be a valid JavaScript object
<p>I am using mongodb driver for nodejs.</p>

<p>I am getting below error while updating a record.</p>

<blockquote>
  <p>{"name":"MongoError","message":"selector must be a valid JavaScript
  object","driver":true}</p>
</blockquote>

<p>Here is my script :</p>

<pre><code>MongoClient.connect(url, function (err, db) {
      if (err) 
      {
        console.log('Unable to connect to the mongoDB server. Error:', err);
        return;
      }
    var collName = "bank";
    var SelectParas = {"name":"ABC"};
    var UpdateValues = {"name":"PQR"};

    db.collection(collName).update(collName,SelectParas,{$set:UpdateValues},function (err,numUpdated){
            if(err)
            {
            console.log('err');
            console.log(err);
            return; 
            }
            if(numUpdated) 
            {
             console.log('Updated Successfully %d document(s).', numUpdated);
            }
                db.close();

            });
});
</code></pre>

<p>I can write the below line in mongo console &amp; it works.</p>

<pre><code>db.bank.update({"name":"ABC"},{$set:{"name":"PQR"}})
</code></pre>