Retrieving values from all keys returns undefined with Firebase Realtime Database in JavaScript

In a small application I am making, I am trying to retrieve a specific note title and text from a parameter from a function I created. The parameter is a key. function viewNote(note) { alert(note) var fetchedNote = database.ref(‘Users/’ + localStorage.getItem(‘username’) + "/Notes/" + note) fetchedNote.on(‘value’, (snapshot2) => { var data = snapshot2.val() for (var… Read More Retrieving values from all keys returns undefined with Firebase Realtime Database in JavaScript

how to fix kotlin lateinit property binding has not been initialized

im getting this error and need help about it as soon as possible java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.bugunneyesem/com.example.bugunneyesem.TariflerPageUser}: kotlin.UninitializedPropertyAccessException: lateinit property binding has not been initialized My activity package com.example.bugunneyesem import android.content.Context import android.content.Intent import android.os.Bundle import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter import androidx.viewpager.widget.ViewPager import com.example.bugunneyesem.databinding.ActivityTariflerPageUserBinding import com.google.firebase.auth.FirebaseAuth import com.google.firebase.database.DataSnapshot… Read More how to fix kotlin lateinit property binding has not been initialized

ERROR FirebaseError: Invalid collection reference.: Collection references must have an odd number of segments, but Notes/id has 2

Good morning everyone, I just started learning Angular programming 3-4 months ago. And right now I’m practicing CRUD using Firestore database. I have this error while I’m trying to delete on my program: ‘core.mjs:10592 ERROR FirebaseError: Invalid collection reference. Collection references must have an odd number of segments, but Notes/r5GucE9DETw36sJKCMgi has 2.’ I tried several… Read More ERROR FirebaseError: Invalid collection reference.: Collection references must have an odd number of segments, but Notes/id has 2

FirebaseError: Invalid collection reference. Collection references must have an odd number of segments

I’m trying to get all the events from Firestore with this function: import { db } from "../firebase"; import { collection, query, getDocs, where } from "firebase/firestore"; import getCurrentUser from "./CurrentUser"; const getEvents = async () => { const uid = getCurrentUser().uid; const eventsRef = collection(db, "events", uid); const que = query(eventsRef, where("creator", "==", uid));… Read More FirebaseError: Invalid collection reference. Collection references must have an odd number of segments

Firestore query: search in array of objects for an object with specific value (nested structure)

I have a nested structure in my Firebase and I’m trying to get the CollectionGroup of guides with specific name. Structure looks like this: DOCUMENT: { dives : [ {guide: { firstName: ‘Jhonny’ } } ] } Image with the structure of my database is attached: Image My code is below: const customerActivitiesQuery = query(collectionGroup(db,… Read More Firestore query: search in array of objects for an object with specific value (nested structure)

realtime database fireabase get reverse data

I’m creating a chat app in flutter using firebase realtime database. But I want to get reverse data to set the chat. can any one help me with this? var fireDatabase3 = FirebaseDatabase.instance.ref("messages"); FirebaseAnimatedList( query: fireDatabase3, reverse: true, itemBuilder: (context, snapshot, animation, index) { if (snapshot.child("chatID").value == chatMainScreenProvider.userDetails["chatID"]) { if (snapshot.child("senderID").value.toString() == sharedPreferenceProvider.userId.toString()) { return… Read More realtime database fireabase get reverse data

How to query Firebase Realtime Database using on() in JavaScript?

I’m trying to query a Firebase Realtime Database to retrieve a specific user based on their email using JavaScript. I want to use the equalTo and orderByChild methods together in my query, but I’m encountering issues. Here’s the code snippet I have: const usersRef = ref(database, ‘users’); const userEmail = "testemail123@gmail.com"; const query = query(usersRef,… Read More How to query Firebase Realtime Database using on() in JavaScript?

behavior differences between firebase realtime database and firestore

i used to use realtime database on firebase and i always used update which used to create if the node is missing. So for the below code: async updateUser(uid: string, payload: any) { const userDocRef = doc(this.firestore, ‘users/’ + uid ); return updateDoc(userDocRef, {"email": "xxx@moblize.it"}); } Realtime db will simply create a new node with… Read More behavior differences between firebase realtime database and firestore