With the old db, I could call Model.get_by_id([1, 2, 3])
to get a list of entities.
Ndb's Model.get_by_id
doesn't support a list of ids as a parameter. What's the best way to replicate the old functionality?
You use the function get_multi which takes a list of keys.
objects = ndb.get_multi([ndb.Key(Model, k) for k in ids])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With