Investigate NODE-3946 - raw option is not working

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • 0
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      NODE-3946 Description
      When including the raw option in MongoClient constructor options I get the following exception with MongoDB 4.4.4 and 5.0.6:

      MongoCompatibilityError: Server at 127.0.0.1:27017 reports maximum wire version 0, but this version of the Node.js Driver requires at least 6 (MongoDB 3.6)

      I have the issue with node driver version 4.3.1.

      Test code:
      import { MongoClient, Long, Int32 } from 'mongodb';
      import { EJSON } from 'bson';

      const dbUri = 'mongodb://127.0.0.1:27017/?writeConcern=majority';

      const clientRaw = new MongoClient(dbUri, {
        raw: true,
        useUnifiedTopology: true,
        enableUtf8Validation: false, // w/ driver 4.3.1
      {color:#d4d4d4}});

      await
      clientRaw.connect();
      const dbr = await clientRaw.db('test');
      const arch = await dbr.collection('arch');
      const doc = await arch.findOne({});
      console.dir(doc);
      console.log(EJSON.serialize(doc));

      await clientRaw.close();
       

       

            Assignee:
            Bailey Pearson
            Reporter:
            TPM Jira Automations Bot
            Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: