I was watching this video which talks about multi-path updates in Firebase. Multi-path updates are great because they allow you to call the firebaseRef.update() method two or more times while having them be one atomic, all-or-nothing operation.
This is great, but in my current situation I don't want to use the update() method. Instead, I want to use the FirebaseRef's push method and allow Firebase to generate a unique key for my object.
The tricky part is that I have denormalized my data so that it's in two places. What I would really like to do is have an atomic, all-or-nothing operation that uses Firebase's push() operation to create a unique key and then save the object with that key in 2 or more different places inside of my database data. However, the syntax for push() already uses an object so is what I want to do even possible?
Note: Another possible solution may be to use Firebase api to somehow generate a unique key in the client and then do a standard multipath update using that generated key as the key for my object being inserted.