Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!