title: Firebase database is giving an error that firebase.database.rel is not a function in web
body: <p>I have been experimenting with Firebase recently. I have implemented Firebase Authentication in my apps but i am experiencing an error with Firebase realtime-database. I have searched online but there are no results for this exact problem. I have been trying to fix it but i can't, I have tried everything.
  Here is my image:
  <a href="https://i.stack.imgur.com/VqmPW.jpg" rel="nofollow noreferrer">Firebase Database error</a></p>
  <p>Here is my <strong>HTML</strong> code:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
      &lt;title&gt;Document&lt;/title&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;
      &lt;script src=&quot;https://www.gstatic.com/firebasejs/7.17.2/firebase.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://www.gstatic.com/firebasejs/7.17.2/firebase-database.js&quot;&gt;&lt;/script&gt;
      &lt;script&gt;
      // Your web app's Firebase configuration
      var firebaseConfig = {
      apiKey: &quot;-----API KEY-------&quot;,
      authDomain: &quot;-----AUTH DOMAIN-----&quot;,
      databaseURL: &quot;----DATABASE URL----&quot;,
      projectId: &quot;----PROJECT ID----&quot;,
      storageBucket: &quot;-----STORAGE BUCKET----&quot;,
      messagingSenderId: &quot;----SENDER ID----&quot;,
      appId: &quot;-----APP ID-----&quot;,
      measurementId: &quot;----MEASURMENT ID -----&quot;
    };
    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);
      &lt;/script&gt;
      &lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          &lt;input type=&quot;text&quot; placeholder=&quot;Enter name&quot; id=&quot;names&quot;&gt;
          &lt;input type=&quot;text&quot; placeholder=&quot;Enter name&quot; id=&quot;rollno&quot;&gt;
          &lt;button onclick=&quot;savedata()&quot;&gt;Save Data&lt;/button&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I have changed <strong>firebase-app.js</strong> to <strong>firebase.js</strong> at <strong>Line 8</strong> in the HTML above but It didn't fix my problem. Also here is my <strong>Javascript</strong>:</p>
  <pre><code>function savedata() {
      var name = document.getElementById(&quot;names&quot;);
      var roll = document.getElementById(&quot;rollno&quot;);
  
      var student = {
          name: name.value,
          rollno: roll.value
      }
      firebase.database().rel('student').set(student)
  }
  </code></pre>
  <p>Right here, i am creating an object student in my firebase realtime-database ,in which i am going to add the values of name and roll no which will all be collected from the user input.</p>