It is possible to create a field named '$' with the update command.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.4.0
    • Component/s: Shell
    • None
    • Environment:
      Ubuntu Server 9.04
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It is possible to created a field named '$' with the update command.

      let:
      db.menu.update(

      {'children.children.label': 'New sub menu'}

      , {$push: {'children.$.$.children':

      {label: 'New new sub menu', children: []}

      }})

      where all 'childen' fields are arrays.

      Expected result:
      the item is pushed at in the right sub children matched by the criteria and 2 level deep because of the positional operator.

      Actual Result:
      { "children" : [
      {
      "$" : {
      "children" : [

      { "label" : "New new sub menu", "children" : [ ] }

      ]
      },
      },
      ]
      }

      On an added note:
      update on 'children.$.children' will not add inside

      {'$': ...}

            Assignee:
            Unassigned
            Reporter:
            Loïc Faure-Lacroix
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: