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

collation.locale caused the results to be unexpected

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Execution
    • ALL
    • QE 2023-11-13

      version: 6.0.8

      dataset:

      { "_id" : ObjectId("64dc9c1ecfae2bd697a5b725"), "_widget_1692174497931" : "视频号❤️", "_widget_1692174497932" : 1 }

      ,

      { "_id" : ObjectId("64dc9c2f77859fe282e9491a"), "_widget_1692174497931" : "视频号❤", "_widget_1692174497932" : 2 }

       
      case1:
       
      db.data.aggregate([
          {
              $match:

      {             "_widget_1692174497931": "视频号❤"         }

          }
      ], {
          collation:

      {         locale: 'zh'     }

      })
       
      result:

      { "_id" : ObjectId("64dc9c1ecfae2bd697a5b725"), "_widget_1692174497931" : "视频号❤️", "_widget_1692174497932" : 1 }

      ,
       

      { "_id" : ObjectId("64dc9c2f77859fe282e9491a"), "_widget_1692174497931" : "视频号❤", "_widget_1692174497932" : 2 }

       
      case2:
      db.data.aggregate([
          {
              $match:

      {             "_widget_1692174497931": "视频号❤"         }

          }
      ])
       
      result

      {     "_id" : ObjectId("64dc9c2f77859fe282e9491a"),     "_widget_1692174497931" : "视频号❤",     "_widget_1692174497932" : 2 }

       
      The two cases are only  collation.locale different。I'm guessing it might have something to do with Unicode
       
      ❤️  \u2764\ufe0f
      ❤  \u2764
      Looking forward to your response!Thanks
         
       
       

            Assignee:
            catalin.sumanaru@mongodb.com Catalin Sumanaru
            Reporter:
            zhanghongweiupup@163.com zhw zhw
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: