-
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
EntityKlass id not set when saving or querying entities #172
Comments
jacobg
changed the title
EntityKlass id not set when saving entity
EntityKlass id not set when saving or querying entities
Jul 19, 2019
sebelga
added a commit
that referenced
this issue
Sep 10, 2019
Hi, |
sebelga
added a commit
that referenced
this issue
Sep 10, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a simple unit test that saved a model I defined:
The returned
foo
is an instance of anEntityKlass
.EntityKlass
has, among many others, the following two properties:It looks like
entityKey
is set after saving, butid
is not. Thus:prints this out:
Also, the
entity.Key
class is defined in@google-cloud/datastore
with theid
property always being a string, even if it's auto-allocated as numeric. This is confusing. It seems that theEntityKlass.id
property perhaps is intended to parse it to its intended type, but as mentioned above it's not doing that here.The same issue also occurs when calling
model.list({ format: "ENTITY"})
.Here's a unit test illustrating this issue:
The text was updated successfully, but these errors were encountered: