Document firebase-document workaround to immutability of firebase-query
@cdata Mentions using firebase-document as a means of adding a new item to an array being queried by firebase-query. As the results of the query are immutable, this is a key piece of functionality in trying to get back to what could be accomplished through the old firebase-collection. See https://github.com/firebase/polymerfire/issues/15.
As a workaround, you can programatically add a document:
var doc = this.create('firebase-document', {
data: newDoc
});
doc.save('/foo/path');
This will actually do a firebase push(...) on /foo/path, so newDoc will be added with a generated ID. Your firebase-query will pick this change up too.
Also the reason I create the element instead of have it in the template... this is because after calling save(...), the path will be set. So all future save(...) calls will try update the same item rather than push a new one.
I was waiting for an answer like that for weeks!
Starting some thinking about how we could do this "for real" in a more built-in way. #112 offers online-only methods that work directly with the Firebase SDK, but I don't think I'd like to merge it until I can rationalize it with offline behavior.