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

raw option is not working

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 6.6.0
    • Affects Version/s: 4.1.3, 4.3.1
    • Component/s: None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            janos.n.hary@gmail.com Janos Hary
            Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: