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

Add documentation for fixed sized arrays

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • mongodb-2.4
    • None
    • manual
    • None

    Description

      From http://codereview.10gen.com/8998011/

      { $push: { a:

      { $each: [ 1 2 3] }

      } }
      is the new $pushAll. The latter will be deprecated in favor of this

      Syntax for creating a fixed sized array is:

      { $push: { a:

      { $each: [1], $trimTo: 5 }

      } }

      I.e after appending the elements in $each, we'd trim the resulting array to 5 elements.

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            sam.weaver Sam Weaver
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11 years, 7 weeks, 1 day ago