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

82
Views
Firebase V9 Database. Batching operations?

How do I batch multiple operations? I found this resource for Firestore https://firebase.google.com/docs/firestore/manage-data/transactions does database have something similar.

I wanted to push a new message collection when chat is created.

export const newChat = () => {
  return push(ref(db, "chats"),{
       ...
    })
    .then((data) => {
        update(ref(db, `chats/${data.key}`), {
        chat_id: key,
      });
        //push(ref(db, `messages/${data.key}`), {
         //text: "hello"
      //});
    })
    .catch((error) => {
      return error;
    });
};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

What you're describing can be accomplished with:

const newRef = push(ref(db, "chats"));
set(newRef, {
  chat_id: newRef.key,
  ...restOfYourObject
});

The call to push does not cause any network traffic yet, as push IDs are a pure client-side operation.

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!