title: Firebase: TypeError: fbRef.child is not a function
body: <p>I'm trying to use firebase for the first time with a web-applicaiton, but I get this error about .child is not a function. Can anyone please show the right way to connect to the firebase database collection, if what i am doing is wrong.</p>
  <p>If I prefer to use mongoDb instead of firebase, how should I implement my post method in this case?</p>
  <p>This is the error I get upon posting the form on the site.</p>
  <blockquote>
  <p>TypeError: fbRef.child is not a function</p>
  <pre><code>at C:\Users\WorkoutApp_v1\routes\workouts.js:32:23
  at Layer.handle [as handle_request] (C:\Users\WorkoutApp_v1\node_modules\express\lib\router\layer.js:95:5)
  at next (C:\Users\WorkoutApp_v1\node_modules\express\lib\router\route.js:137:13)
  at Route.dispatch (C:\Users\WorkoutApp_v1\node_modules\express\lib\router\route.js:112:3)
  at Layer.handle [as handle_request] (C:\Users\WorkoutApp_v1\node_modules\express\lib\router\layer.js:95:5)
  at C:\Users\WorkoutApp_v1\node_modules\express\lib\router\index.js:281:22
  at Function.process_params (C:\Users\WorkoutApp_v1\node_modules\express\lib\router\index.js:335:12)
  at next (C:\Users\WorkoutApp_v1\node_modules\express\lib\router\index.js:275:10)
  at Function.handle (C:\Users\WorkoutApp_v1\node_modules\express\lib\router\index.js:174:3)
  at router (C:\Users\WorkoutApp_v1\node_modules\express\lib\router\index.js:47:12)
  </code></pre>
  </blockquote>
  <p>This is the post method in my router file.</p>
  <pre><code>var express = require('express');
  var router = express.Router();
  const Firebase = require('firebase');
  const fbRef = 'https://console.firebase.google.com/project/workout-7f912/database/firestore  /data~2Fexercise~2F2zCvky1fWQcD14tTCq8B';
  
  router.post('/add', function(req,res,next) {
  var workout = {
      name: req.body.Name,
      discription: req.body.Discription,
      set: req.body.Set,
      RepsTime: req.body.RepsTime
  }
  // console.log(workout);
  // return;
  
  var dbRef = fbRef.child('workouts');
  dbRef.push().set(workout);
  
  req.flash('success_msg', 'Workout saved');
  res.redirect('/workouts');
  });
  </code></pre>