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

[CQF] Queries with field path references fail if they contain a dot, dollar, or empty field

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • QO 2022-07-25, QO 2022-08-08, QO 2022-08-22, QO 2022-09-05, QO 2022-09-19, QO 2022-10-03, QE 2022-10-17

      This bug is relevant only for CQF/bonsai. Since the ABT translation layer relies on FieldPath (e.g. here), the restrictions on field names are different than the existing find/agg systems.

      As an example, the following query should work:

      assert.commandWorked(coll.insert({a: {$b: 1}}));
      assert.eq(1, coll.find({"a.$b": 1}).itcount());
      

      But instead throws with ""FieldPath field names may not start with '$'. Consider using $getField or $setField."

      At least two relevant JS tests are field_name_empty.js and field_name_validation.js.

            Assignee:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: