Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8099099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:17:34+00:00 2026-06-05T22:17:34+00:00

In doing a bit more programming with Firebase today, I found myself wishing for

  • 0

In doing a bit more programming with Firebase today, I found myself wishing for a couple of features:

1) Merge set:

Say I have a firebase ref that has the value {a:1,b:2,c:3}.

If I do something like ref.set({a:-1,b:-2}) the new value will (unsurprisingly) be {a:-1,b:-2}.

Instead, imagine ref.mergeSet({a:-1,b:-2}) which would have a result in the value of the ref being {a:-1,b:-2,c:3}.

Now, I realize that I could do something like ref.child("a").set(-1) and ref.child("b").set(-2) to achieve this result, but in at least some cases, I’d prefer to get only a single call to my .on() handler.

This segues into my second idea.

2) Batch set:

In my application I’d like a way to force an arbitrary number of calls to .set to only result in one call to .on in other clients. Something like:

ref.startBatch()
ref.child("a").set(1)
ref.child("b").set(2)
....
ref.endBatch()

In batch mode, .set wouldn’t result in a call to .on, instead, the minimal number of calls to .on would all result from calling .endBatch.


I readily admit that these ideas are pretty nascent, and I wouldn’t be surprised if they conflict with existing architectural features of Firebase, but I thought I’d share them anyway. I find that I’m having to spend more time ensuring consistency across clients when using Firebase than I expected to.

Thanks again, and keep up the great work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:17:35+00:00Added an answer on June 5, 2026 at 10:17 pm

    UPDATE: We’ve added a new update() method to the Firebase web client and PATCH support to the REST API, which allow you to atomically modify multiple siblings at a particular location, while leaving the other siblings unmodified. This is what you described as “mergeSet” and can be used as follows:

    ref.update({a: -1, b: -2});
    

    which will update ‘a’ and ‘b’, but leave ‘c’ unmodified.


    OLD ANSWER

    Thanks for the detailed feature request! We’d love to hear more about your use case and how these primitives would help you. If you’re willing to share more details, email support@firebase.com and we can dig into your scenario.

    To answer your question though, the primary reason we don’t have these features is related our architecture and the performance / consistency guarantees that we’re trying to maintain. Not to go too deep, but if you imagine that your Firebase data is spread across many servers, it’s easier for us to have stronger guarantees (atomicity, ordering, etc.) when modifying data that’s close in the tree than when modifying data that’s far away. So by limiting these guarantees to data that you can replace with a single set() call, we push you in a direction that will perform well with the Firebase architecture.

    In some cases, you may be able to get roughly what you want by just reorganizing your tree. For instance, if you know you always want to set ‘a’ and ‘b’ together, you could put them under a common ‘ab’ parent and do ref.child('ab').set({a:-1, b:-2});, which won’t affect the ‘c’ child.

    Like I said, we’d love to hear more about your scenario. We’re in beta so that we can learn from developers about how they’re using the API and where it’s falling short! support@firebase.com 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not too sure if I'm doing this right. It looks a bit more convoluted
I'm doing a bit of coding, where I have to write this sort of
I was doing a bit research and I came across this comment. I have
My first post here :) I have a summer job doing a bit of
I want to have a bit more of a look at the resulting ASM
I'm finding myself doing more C/C++ code against Win32 lately, and coming from a
I'm doing a proof of concept thing here and having a bit more trouble
I'm doing a bit more statistical analysis on some things lately, and I'm curious
After doing a bit of digging i found some (minor - in my opinion)
I'm doing a bit of Powershell scripting ( for the first time ) to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.