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

Add documentation for fixed sized arrays

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • mongodb-2.4
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      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.

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

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