Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13688

Picky errors from 2.6 are needlessly backwards incompatible

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 2.6.0
    • None
    • None
    • ALL
    • Hide

      db.foo.update({$set: {}});
      db.foo.update({}, {$unset: {}});
      db.foo.find({$text:

      { $search: 'green' }

      }).hint(

      { foo: 1 }

      );

      Show
      db.foo.update({$set: {}}); db.foo.update({}, {$unset: {}}); db.foo.find({$text: { $search: 'green' } }).hint( { foo: 1 } );

    Description

      MongoDB 2.6 will throw an error in the following situations:

      • Someone tries to use hinting with a $text index. I understand you don't support it, but in the past, features that were incompatible with hinting (like "count" until somewhere in 2.5.x) just caused it to be ignored. No need to break working code over it.
      • An empty $set clause is used. Why force developers to add code to specifically not supply an empty $set clause when it's easily ignored by the server and it was valid in 2.4.x?
      • An empty $unset clause is used. See above.

      All three of these are a hassle to avoid when building queries dynamically.

      Perhaps an error log level for "linting" would be a more appropriate place to report this kind of thing.

      • * *

      The move to 2.6 has been worth it for us due to the availability of text searches as part of normal queries, which is a big improvement in the ease of writing query builder code. Thank you for that change.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              boutell Thomas Boutell
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: