db.get() vs Model.get()
-
25-10-2019 - |
Question
I have started working on the datastore and I found that we can get the instance(s) by this method get() which was available in db and in Model class. But what the difference between them I don't find it my questions are
1. how its working in background to get the Instance of an Model
2. how the performance wise of use db.get() and Model.get()
3. When use db.get() and Model.get()
Thanks you
Solution
They're effectively identical. They call the same RPC and have the same performance.
The only difference is that Model.get
validates that the key matches the model's kind.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow