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

Allow for injection of BSON library into MongoClient

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Won't Do
    • None
    • None
    • BSON, Native
    • None

    Description

      Currently, the driver relies on the 1.x branch of BSON. It does some auto-detection to detect if bson-ext is present, and will use that instead.

      In the next major version of the driver, we will be upgrading to use BSON 4.x.

      Instead of using auto-detection logic like we do currently for bson-ext, we should allow users to provide their own BSON implementation to the MongoClient.

      Default behavior:

      // Uses BSON v4
      const client = new MongoClient(url);
      

      // Import bson-ext (will likely require a breaking version of bson-ext for this)
      const bson = require('bson-ext');
       
      // MongoClient now uses bson-ext
      const client = new MongoClient(url, { bson });
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: