Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6503

Add Int32 as a schema type to Mongoose

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • mongoose-8.9
    • Affects Version/s: None
    • Component/s: None
    • Not Needed

      Use Case

      As a... mongoose user
      I want... to provide accurate information to BSON
      So that... I can use encryption properly for numeric types

      Acceptance Criteria

      Implementation Requirements

      Testing Requirements

      • Follow testing for existing schemaTypes
      • Test that in the following cases the Int32 SchemaType throws 
        • Below INT32_MIN
        • Above INT32_MAX
        • decimal value
        • invalid value (after numeric coercion)
      • Integration tests
        • When a model with an Int32 field is inserted, then the correct BSON type of Int32 is inserted for that field 
        • When promoteValues is not set / undefined / false and a document with an Int32 is fetched / find(), then a number is returned
        • When promoteValues is set and a document with an Int32 is fetched / find(), then a BSON Int32 Type Class is returned

      Documentation Requirements

      • Add API documentation

            Assignee:
            aditi.khare@mongodb.com Aditi Khare
            Reporter:
            bailey.pearson@mongodb.com Bailey Pearson
            Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: