-
Notifications
You must be signed in to change notification settings - Fork 53
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
Saving multiple Entities #29
Comments
I realise this is actually rather related to #22 , and more complicated than I thought because the query is not returning a group of Entities we can easily update / save with all the relevant information. |
Hi, that's an interesting thing to add. Yes it is related to #22 to be able to query and receive entities instances (not just data + id). I could then add a new global method to save an array of entities. |
Great, thanks! Really appreciate all the work you've put into this extension of the Datastore @sebelga. Best solution for NodeJS by far 😄 Also, it may help to take a look at Objectify to get ideas of what's been done well before in other languages. I used it a lot before moving over to Node and was quite impressed with it too. |
Thanks for the kind words! :) I will have a look at Objectify, seems very interesting! Any feature you found specially useful that we could implement here? |
Hi, just release v0.9.0 with this feature. Could you please try to see if it works for you? thansk! |
Happy to confirm it is working as intended! As well as validating geoPoints when the structure is correct. Thanks for the quick release! |
Hi there,
I see you've got the equivalent of the
datastore.save( entity )
method, which we can access in this library the other way round withentity.save();
- returning a promise or passing in a callback if we like to save a single element.I'm wondering if there is anything which would be the equivalent of
datastore.save( entities[] )
For example, in my code:
The reason I ask is because if I'm not mistaken, batch saving large groups of entities (as I'm trying to do here, basically running through all the entities of a kind and re-saving them- in order to re-index their properties if I changed the schema) can be optimised when its done in groups instead of individually every time.
I suppose I could use the
google-cloud-node
library to re-save them, but would I not lose the schema then? When I look at the data that is being returned in the query, it appears that it's just a bunch of plain data- no extra schema information or even functions so I'm unsure ifentity.save()
would actually even work either.I'm going to play around with it for a bit. But let me know if there is a solution I may be overlooking.
The text was updated successfully, but these errors were encountered: