javascript - Firebase - set priority when doing an update/fanout to several nodes -
i'm writing several parts/nodes of firebase database in 1 update. possible set priority of node when doing this? example:
firebaseref.update([ "/some/node/": "value", "/some/other/node": "other value" ])
what if want set priority of node @ "/some/other/node" @ same time. possible? like:
firebaseref.update([ "/some/node/": "value", "/some/other/node": { value: "other value", priority: 0 - date.now() } ])
you got it, "magic" property named .priority
:
firebaseref.update([ "/some/node/": "value", "/some/other/node": { value: "other value", ".priority": 0 - date.now() } ]
note there aren't lot of reasons use priorities anymore in firebase. adding named property (e.g. "reversedtimestamp": 0 - date.now()
) accomplish same , less hidden/magic.
update
it seems want update node's value, not child named value. set (primitive) value , priority in 1 go, use:
firebaseref.update([ "/some/node/": "value", "/some/other/node": { ".value": "other value", ".priority": 0 - date.now() } ]);
Comments
Post a Comment