title: Unable to find if a node exists in realtime database
body: <p><a href="https://i.stack.imgur.com/9NE3P.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9NE3P.jpg" alt="enter image description here" /></a></p>
  <p>I have a firebase realtime tree which has a particular node <code> New Ride</code> set when the user is online, when offline the node <code>New Ride</code> gets removed. This works ok for the first time, When the user tries to go online again I can't set up the node.  I want to check if the node already exists in the tree if not add it.</p>
  <p>This is my code so far</p>
  <pre><code>DatabaseReference rideRequestRef = FirebaseDatabase(databaseURL: firebaseUrl)
      .reference()
      .child(&quot;Drivers&quot;)
      .child(currentFirebaseUser.uid)
      .child(&quot;New Ride&quot;);
  var ref = FirebaseDatabase(databaseURL: firebaseUrl)
          .reference()
          .child(&quot;Drivers&quot;)
          .child(currentFirebaseUser.uid);
  
      await ref
          //.child(currentFirebaseUser.uid)
          .child(&quot;New Ride&quot;)
          .once()
          .then((DataSnapshot dataSnapshot) {
        if (dataSnapshot == null) {
         
          rideRequestRef.set(&quot;searching&quot;);
        } else {
          rideRequestRef.set(&quot;searching&quot;);
         
        }
      });
     
      rideRequestRef.onValue.listen((event) {});
    }
  </code></pre>