Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2446

using $set for arrays nested in arrays

    XMLWordPrintableJSON

Details

    • Icon: Tracking Tracking
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • v1.3.1
    • mongodb-2.6
    • manual
    • None
    • windows 7

    Description

      I am trying to update a nested document structure which looks similar to this:
      { k1 : v1,
      k2 : [
      {inner_k1: inner_v1,
      inner_k2: [

      {inner_inner_k1: inner_inner_v1, inner_inner_k2: inner_inner_v2 }

      ]
      }
      ]
      }

      What is the appropriate way to $set another field in the inner-most document, e.g. inner_inner_k3: inner_inner_v3?

      Thanks.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            pavelgrib Paul Gribelyuk
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 51 weeks, 6 days ago