Skip to content

Conversation

rueckstiess
Copy link
Contributor

@rueckstiess rueckstiess commented Nov 13, 2016

This PR includes a number of updates to external modules:

  • mongodb-language-model@1.0.2 now using the pegjs implementation for richer feature support and faster query verification.

  • collection-sample@1.3.0 now supporting promoteValues option, which can be set to false to retain the original BSON types for numeric values (Decimal128, Long, Double, Int32)

  • mongodb-schema@6.0.2 update now supports promoteValues in the command line tool (no changes required for Compass though)

  • detect-coordinates@0.2.0 can now recognise coordinates in both promoted and unpromoted form (i.e. looking for Number, Int32 or Double type inside coordinates array).

  • mongodb-data-service@2.1.1 includes the new collection-sample changes and passes through the promoteValues option.

  • extended-json@1.8.0 adds support for $numberDecimal / Decimal128, which is required to build queries and document validation rules with Decimal.

All of these are updated for this PR.

Further changes:

  • Numeric values are no longer promoted to the Javascript type "Number". Instead, the BSON type is maintained and we differentiate between Int32, Double, Long, Decimal128.
  • removal of ./src/app/models/editable-query.js, no longer needed. Query is now a pure javascript object.
  • Minicharts correctly extract the numeric values from the 4 number types. Query building will use Extended JSON format to correctly build queries on these types, e.g. {price: {$gt: {$numberDecimal: "12.99"}}}.
  • Fixed a bug in src/internal-packages/query/lib/util/index.js where determining if a minichart histogram bar is selected or not had a bug for negative values.
  • Behavioral change (which I think makes sense): Int32, Double and Decimal128 types now always use the histogram minichart. String and Long use the histogram minichart when duplicates have been detected, otherwise they use the unique bubbles minichart.

@rueckstiess rueckstiess force-pushed the COMPASS-287-distinct-numeric-types branch from 6dbc18d to 575bd97 Compare November 13, 2016 10:48
@imlucas
Copy link
Contributor

imlucas commented Nov 14, 2016

lgtm

@imlucas imlucas merged commit 36fd83b into master Nov 14, 2016
@imlucas imlucas deleted the COMPASS-287-distinct-numeric-types branch November 14, 2016 04:18
@rueckstiess
Copy link
Contributor Author

@imlucas If this is backportable without merge conflicts, let's do it.

pzrq pushed a commit that referenced this pull request Nov 15, 2016
* COMPASS-287 upgrade old language-model to pegjs

* fix bar selection rounding bug for negative, very large numbers and 0.

* don’t promote values.

* allow dotted field names and fix type switching bug

* remove debug statements.

* handle number ranges correctly for unpromoted bson types

* fix query building for negative long values.
@pzrq
Copy link
Contributor

pzrq commented Nov 15, 2016

Backported in 87ac280

Resolved one package.json conflict by backporting #568 (COMPASS-224), resolved the other by not taking mongodb-shell-to-url which is master (1.6.0-dev) only, no other git merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants