Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

107
Vistas
How do I achieve this using firebase 9 push?

I switch to firebase 9 and want to achieve following

customers
   -MomOdRNzkqr9vDk_MmE:"ptwXJ7JRAASFgd3KoS2fQyQhyV613"
   -Myb3b_2W-7FTlsZvXCO:"QZOQ43DGYwfu4djlZ5EjEVksOr53"

I am trying the following

const customerSelectedRef = ref(db,`/serviceProvider/${user1.uid}/moneyCollector/customers`);
const customerSelectedRefPush = push(customerSelectedRef);
set(customerSelectedRefPush, customerSelected); // not wanted to use {customerSelected} which gives key value pair under push id

How could add value directly to push id?

1

The old method was

  firebase
    .database()
    .ref(`/serviceProvider/${user1.uid}/moneyCollector/customers`)
    .push(customerSelected)
    .then(() => {
      console.log("Data set.moneyCollector cutomer added");
      checkdubArray = [];
    });

Where push id acts as key for customerSelected and I try to get same result in firebase 9. Dont want the result which I have marked as cross

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can pass the string value directly in push() along with the DatabaseReference as shown below:

const customerSelectedRef = ref(db,`/service/${user1.uid}/Collector/customers`);

await push(customerSelectedRef , "string_value") // Not object

The result would be:

enter image description here

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda