title: How to perform MongoDB CRUD operations through javascript?
body: <p>I'm trying to automate modifications made on tag ranges. But I keep getting an "SyntaxError: Unexpected identifier at ..." error at the first 'db.tags.remove...'.</p>
  
  <pre><code>...
  today = yyyy+mm+dd;
  balancing = sh.getBalancerState();
  
  if (! balancing) {
      conn = new Mongo("mongoserver.mydomain.com:27017");
      db = conn.getDB("config");
      db.tags.remove({ _id: { ns: "mydb.mycoll", "min": { "day:" MinKey }}, tag: "LTS" });
      db.tags.remove({ _id: { ns: "mydb.mycoll", "max": { "day:" MaxKey }}, tag: "STS" });
      sh.addTagRange("mydb.mycoll", { day: MinKey }, { day: today }, "LTS");
      sh.addTagRange("mydb.mycoll", { day: today }, { day: MaxKey }, "STS");
  };
  ...
  </code></pre>
  
  <p>Any help would be most welcome,</p>
  
  <p>Thanks,</p>
  
  <p>Greg.</p>