Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mutate a ndb repeated property?

The appengine docu says on repeated ndb properiertes, that:

When updating a repeated property, you can either assign it a new list or mutate the existing list in place.

https://developers.google.com/appengine/docs/python/ndb/properties#repeated

Two questions:

  1. do I save write operations when I just mutate the list, instead of putting a new list in place?

  2. how do I do exactly the mutation? just append the object and delete items within the list as I would do it with a list in python?

Thanks!

like image 614
Sebastian Küpers Avatar asked Feb 06 '13 13:02

Sebastian Küpers


1 Answers

Yes you have it correct in your mind.

  1. No you don't save because it's still a write operations with the applied costs.
  2. Yes exactly like that. Appending like a normal list, deleting, etc etc.
like image 119
Jimmy Kane Avatar answered Sep 19 '22 17:09

Jimmy Kane