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

Unable to use ArrayFilters option with stitch_support_v1_update_create

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Create a collection with the sample document in the description

      attempt to call stitch_support_v1_update_create with the sample parameters from the operations in the description

      Show
      Create a collection with the sample document in the description attempt to call stitch_support_v1_update_create with the sample parameters from the operations in the description
    • Sprint:
      Query 2020-11-30

      Description

      I am using the Realm Go backend (with cgo) to call stitch_support_v1_update_create with an arrayFilters option but I keep see the following error every time:

      {No array filter found for identifier 'element' in path 'grades.$[element]'}]}
      

      I have a collection with a single document as such:

      { "_id" : 1, "grades" : [ 95, 92, 190 ] }

      and am trying to run the following operation:

      collection.updateOne(   { },   { $set: { "grades.$[element]" : 100 } },   {      arrayFilters: [ { "element": 190 } ]   })

      Operations without an arrayFilter work property but I also get the correct error when I pass in multiple array filters with the correct name e.g.

      collection.updateOne(   { },   { $set: { "grades.$[element]" : 100 } },   {      arrayFilters: [ { "element": 190 }, { "element": 180 } ]   })

      gives:

      Found multiple array filters with the same top-level field name element

      The arrayFilter bytes sent to stitch_support_v1_update_create seem to be correct, and the filters seem to get parsed correctly, but something appears to be off when the update tries to find the appropriate filter

        Attachments

          Activity

            People

            Assignee:
            jacob.evans Jacob Evans
            Reporter:
            kush.patel Kush Patel
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: