Skip to content

Conversation

durran
Copy link
Member

@durran durran commented Aug 21, 2016

Compass no longer uses the Javascript type Number for numbers in the documents, it now uses the correct BSON type for serialization, either Int32, Int64, or Double.

This pull also fixes the auto-casting for the numbers. The following behaviour now happens:

  1. When an Int32 is edited to a value over 32bits, the type automatically casts to Int64.
  2. When an Int64 is edited to a value over 64bits, the type automatically casts to String.
  3. When an Int32 is edited to a value over 32bits, the types drop-down contains both Int64 and Double until the value passes (+/-) Number.MAX_SAFE_INTEGER, then the drop-down only contains Int64 as a numeric value to cast to.

This change is Reviewable

@durran durran force-pushed the INT-1763-auto-cast branch from 6cd5fd5 to c5e0772 Compare August 21, 2016 14:43
@durran durran merged commit 3470613 into master Aug 22, 2016
@durran durran deleted the INT-1763-auto-cast branch August 22, 2016 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant