title: Firebase Realtime database rule to avoid duplicate value
body: <p>I have the following structure in Firebase Realtime database : </p>
  
  <pre><code>{
    "e_pass": [
      {
        "address": "M12, AV Colony",
        "epass_id": "RPR/0003",
        "epass_vehicle_id": "na",
        "from_city": "Raipur",
        "from_date": "31-03-2020",
        "from_district": "Raipur",
        "from_location": "AV Colony Mowa",
        "isApproved": "1",
        "mobile_number": "99999999",
        "time_stamp": 1585577315093,
        "user_name": "John Doe",
        "vehicle_number": "CG04HX1234"
      }
    ]
  }
  </code></pre>
  
  <p>I am trying to apply the following rule to prevent the duplication of key <code>mobile_number</code>:</p>
  
  <pre><code>{
    "rules": {
      "e_pass": {
        ".read": true,
        ".write": {
          "$mobile_number": {
            ".write" : "!data.parent().hasChild($mobile_number)"
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>but it keeps failing. What should be the rule?</p>