- The user can add contacts to the general contacts set, which is shared
among all users.
- The contacts set will eventually be quite, quite large.
- The user uploads sets of contacts from an external source, so I get
them all at once.
- A new contact record will be created for every single phone number,
which will be used as the key for the object. (e.g., 16125555555)
So, here's the question: I'd ideally like to take the whole batch of new
contacts, standardize the number formats, rip out the data I need, and
create the objects in one pass client side and then send the whole set back
to firebase. But the catch is that some of those contacts may already
exist, so if I just do a simple "set", I'll overwrite the existing contact.
I could cycle through each one and do a set at the specific key, but not
only will that be costly, but I would have to go one level lower to ensure
no data is overwritten (if they key is the same, I want to *add* data to
the key, not overwrite existing properties). I could use update, but then I
don't get the new ones. I could pull down the whole contact data set,
iterate through it client side, and send it back all together but that's
going to be slow both on the network (the data sets can be quite large) and
client side (a lot of processing).
Ideally, there would be some setOrUpdate function... but I don't think that
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To post to this group, send email to firstname.lastname@example.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/c47a96c7-0c0e-4b74-a534-661eca96ab87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.