Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-979

Add support for $size expression in project and group aggregation pipeline

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5 GA (Dijkstra), 1.5.1 (Dijkstra SR1)
    • Fix Version/s: 1.7 GA (Fowler)
    • Component/s: Aggregation framework
    • Labels:
      None

      Description

      Mongodb 2.6 supports the $size expression in project and group pipelines.

      Please add its support in aggregation pipeline. Here are two examples of using it in project and group:

      db.users.aggregate(
         [
            {
               $project: {
                  tags_count: {$size: "$tags"}
               }
            }
         ]
      )
      
      db.users.aggregate(
         [
            {
               $group: {
                  _id: "$username",
                  tags_count:  {$first: {$size: "$tags" }}
               }
            }
         ]
      )
      

        Attachments

          Activity

            People

            Assignee:
            thomasd Thomas Darimont
            Reporter:
            faisalferoz Faisal Feroz
            Last updater:
            Oliver Drotbohm
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: