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

$ne perform a case sensitive find when it should do a case insensitive find based on collation settings

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.2
    • Fix Version/s: 3.4.3, 3.5.4
    • Component/s: Indexing, Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Steps To Reproduce:
      Hide

      use admin
      db.runReadCommand({ setFeatureCompatibilityVersion:"3.4"})
      use testdb
      db.createCollection("testcollection",{collation:{locale: "sv", strength:1, numericOrdering:true}})
      db.testcollection.insert( { data: "test" } )
      db.testcollection.insert( { data: "TEST" } )
       
      > db.testcollection.find({ data: { $eq: "test" } })
      { "_id" : ObjectId("58a461e0aa464d5347f68ecb"), "data" : "test" }
      { "_id" : ObjectId("58a461f0aa464d5347f68ecc"), "data" : "TEST" }
       
      > db.testcollection.find({ data: { $ne: "test" } })
      { "_id" : ObjectId("58a461f0aa464d5347f68ecc"), "data" : "TEST" }
      >//the above query should not result in any document but it returns the one with uppercase.
      

      Show
      use admin db.runReadCommand({ setFeatureCompatibilityVersion:"3.4"}) use testdb db.createCollection("testcollection",{collation:{locale: "sv", strength:1, numericOrdering:true}}) db.testcollection.insert( { data: "test" } ) db.testcollection.insert( { data: "TEST" } )   > db.testcollection.find({ data: { $eq: "test" } }) { "_id" : ObjectId("58a461e0aa464d5347f68ecb"), "data" : "test" } { "_id" : ObjectId("58a461f0aa464d5347f68ecc"), "data" : "TEST" }   > db.testcollection.find({ data: { $ne: "test" } }) { "_id" : ObjectId("58a461f0aa464d5347f68ecc"), "data" : "TEST" } >//the above query should not result in any document but it returns the one with uppercase.
    • Sprint:
      Query 2017-03-06

      Description

      Using the following collation settings on collection collation:

      {locale: "sv", strength:1, numericOrdering:true}

      makes $eq searches case insensitive.
      But when the filter is $ne it is not case insensitive.

        Activity

        Hide
        thomas.schubert Thomas Schubert added a comment -

        Hi daniel moqvist,

        Thank you for reporting this issue. We're investigating and will continue to update this ticket.

        Kind regards,
        Thomas

        Show
        thomas.schubert Thomas Schubert added a comment - Hi daniel moqvist , Thank you for reporting this issue. We're investigating and will continue to update this ticket. Kind regards, Thomas
        Hide
        xgen-internal-githook Githook User added a comment -

        Author:

        {u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}

        Message: SERVER-28017 ne should respect the collection default collation
        Branch: master
        https://github.com/mongodb/mongo/commit/89d37b751cb9404a81a33f4effc5c4657a17b359

        Show
        xgen-internal-githook Githook User added a comment - Author: {u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'} Message: SERVER-28017 ne should respect the collection default collation Branch: master https://github.com/mongodb/mongo/commit/89d37b751cb9404a81a33f4effc5c4657a17b359
        Hide
        xgen-internal-githook Githook User added a comment -

        Author:

        {u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}

        Message: SERVER-28017 ne should respect the collection default collation
        Branch: v3.4
        https://github.com/mongodb/mongo/commit/131e03e5dc4fa94d44f600d2844b470ede4f1d4e

        Show
        xgen-internal-githook Githook User added a comment - Author: {u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'} Message: SERVER-28017 ne should respect the collection default collation Branch: v3.4 https://github.com/mongodb/mongo/commit/131e03e5dc4fa94d44f600d2844b470ede4f1d4e

          People

          • Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

                Agile