Skip to content

Conversation

@aditi-khare-mongoDB
Copy link

@aditi-khare-mongoDB aditi-khare-mongoDB commented Nov 13, 2024

Summary

Motivation
Support a IEEE 754-2008 floating point type in mongoose for compatibility with CSFLE/QE. The current Number schema type can result in either Int32, Int64, or Doubles that are inserted into the database using type inference but CSFLE and QE require exact BSON types in schemas.

Summary of Changes

  • Same changes as NODE-6503 but for Double.
  • Add SchemaType Double, which has the following behavior:
    • its default cast method throws when provided a
      • a non-numeric string
    • it is queryable as $type: double or $type: number
  • Add API Docs for new query option and new schema type

Example

const vehicleSchema = new Schema({ gasLevel: mongoose.Schema.Types.Double });

@aditi-khare-mongoDB aditi-khare-mongoDB changed the title feat(NODE-6405): Add Double as a SchemaType feat(NODE-6504): Add Double as a SchemaType Nov 13, 2024
@aditi-khare-mongoDB aditi-khare-mongoDB marked this pull request as ready for review November 13, 2024 15:51
Copy link

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small comments

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.

3 participants