-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-paths update and Geofire #76
Comments
I think this is a great suggestion and I think we can find a way to work this into the API. It will be a little while before I have time to implement this, but I'm happy to code review PRs from the community. Otherwise, once I have some time to take a crack at this, I'll go ahead and see how we can support this kind of feature. Thanks for opening this issue! |
Ah great Jacob Many thanks, |
+1. Atomic updates are really important to ensure the integrity of the database. |
Do we have a solution for the problem now. |
+1 maybe instead |
Playing fast and loose here, so disregard if this is totally whacked, but couldn't we just have a method that returns the geofire data that would be updated? Then we could just use the existing atomic update api. |
Any movement on this? I like @jcheroske's suggestion as long as there isn't any behind the scenes wizardry in the "set" method that would confound this solution |
checking the set function inside module at ../node_modules/geofire/dist/geofire/index.cjs.js" there wasn't really sophisticated method or external library that help update geofire hash to firebase. It's just plan method and validation. as @ghost suggested earlier, instead of returning a promise for updating the data, you can simple return newData, then do the uploading yourself. you can simply copy and paste below function, then you can do something like `var map = {}; firebase.database().ref('/').update(map);` `function getGeoFireHashes(keyOrLocations, location) { /**
/**
/**
function validateKey(key) { function validateLocation(location) { |
Hi,
As mentioned here, I think it should be great to easily multi update data paths and a geofire path at the same time. As the set of Geofire is pretty complex, it's hard to directly copy/paste the code to make it works.
Here the use case : (I use the same as the link above but add a path to know where a post is located). So the structure :
Now I can add a post at the same time at users and posts (with multi-path update). But I need to set the position after. In my use case, a post without a position is not valid data, it's for that the best should be to do the 3 updates at the same times (if one fails, all fail).
Deleting Geofire path is easy (using update(null)), we can multi-update for delete, but for set/update, I loop for a way to do that easily,
Cheers,
Clément
The text was updated successfully, but these errors were encountered: