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

retryWrites=true, remove, and limit=0

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.2.0
    • Affects Version/s: 3.0.10
    • Component/s: Native
    • Labels:

      when I run the following node script:

      #!/usr/bin/env node
      'use strict';
      
      const env = require('/Users/lineus/.env');
      const { MongoClient } = require('mongodb');
      
      const sharable = env.ATLASSRV
        .replace(/\/[^:]+:[^@]+@/, '//**:**@')
        .replace(/cl[^:]+mon/, 'cluster.mon');
      
      const pkg = require.resolve('mongodb').replace(/\/[^/]*$/, '/package.json');
      const ver = require(pkg).version;
      
      async function run() {
        console.log(`version: ${ver}`);
        console.log(`conn string: ${sharable}`);
        const client = await MongoClient.connect(env.ATLASSRV);
        const db = client.db('gh-6610');
        await db.dropDatabase();
        await db.collection('tests').insert({ name: 'Billy' });
        let found = await db.collection('tests').findOne({});
        console.log(found);
        await db.collection('tests').remove({ _id: found._id })
          .catch((e) => {
            console.error(e.message);
            return client.close();
          });
      }
      
      run();
      
      

      I get the following output:

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      issues: ./6610_native.js
      version: 3.0.10
      conn string: mongodb+srv://**:**@cluster.mongodb.net/test?retryWrites=true
      { _id: 5b3247c7bcf86f208bdc5990, name: 'Billy' }
      Cannot use (or request) retryable writes with limit=0
      issues:
      

       

      I noticed NODE-1513 says that there changes coming to retryWrites in the next driver version but I wasn't sure if those changes apply to this code. It looks like the spec doesn't mention `remove` as being supported by retryWrites. Going forward will there be any effort to make remove compatible with retryWrites?

       

            Assignee:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Reporter:
            lineus@gmail.com Kevin Huff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: