When $merge "on" field uses default value, it doesn't respect collation

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • Hide

      See repro.js

      Show
      See repro.js
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When the user doesn't specify "on" field for $merge, it default to _id (+ shard key for sharded collections).

      When the default value is used for "on", there is no validation that there is actually a unique index to support the $merge, because we assume that the default value of "on" is definitely unique.

      But this doesn't account for collation, as the values of _id might not be unique, according to the providing collation, which might lead to $merge perfoming whenNotMatched action, while actually a matching document exists.

      See repro.js

       

            Assignee:
            Evan Bergeron
            Reporter:
            Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: