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

Add documentation for fixed sized arrays

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: mongodb-2.4
    • Component/s: manual
    • Labels:
      None
    • # Replies:
      0
    • Last comment by Customer:
      true

      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

          Issue Links

            Activity

              People

              • Assignee:
                sam.kleinman Sam Kleinman
                Reporter:
                sam.weaver Sam Weaver
                Participants:
                Last commenter:
                Jonathan Dahl
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since reply:
                  7 years, 13 weeks, 4 days ago
                  Date of 1st Reply: