Repository navigation
Remove Int and Double boxing #113
Description
Activity
SGTM.
Isn't boxing them the only way we do the detection? https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/lib/datastore/entity.js#L208-215:
if (v instanceof Int) { p.integerValue = v.get(); return p; } if (v instanceof Double) { p.doubleValue = v.get(); return p; }
If we remove them, how would a user specify they want a double?
There would be no explicit way to force a field to be double. If it's not a floating point number, we will persist it as uint64 in the backend.
I'm wondering about the impact it has to the backend and indexing. cc/ @pcostell
Unfortunately indexing uses property type to determine order: https://developers.google.com/appengine/docs/java/datastore/indexes#Java_Properties_with_mixed_value_types
When two entities have properties of the same name but different value types, an index of the property sorts the entities first by value type and then by a secondary ordering appropriate to each type. For example, if two entities each have a property named age, one with an integer value and one with a string value, the entity with the integer value always precedes the one with the string value when sorted by the age property, regardless of the property values themselves.
Ah, an immediate WONTFIX then. Thanks.
- addedtriage meI really want to be triaged.I really want to be triaged.🚨This issue needs some love.This issue needs some love.
on Apr 6, 2020 57 remaining items
- added a commit that references this issue
on Mar 5, 2026 - added a commit that references this issue
on Mar 17, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
We don't seem to need to provide boxing to be more precise. Current way of detecting double numbers seem to be working fine. I want to remove Int and Double custom types for cleanup.
Does it sound good?