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

Comment on: "manual/reference/sql-aggregation-comparison.txt"

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 01112017-cleanup
    • None
    • None

    Description

      Document says the equivalent of select count from orders is as under:
      db.orders.aggregate( [
      {
      $group: {
      _id: null,
      count:

      { $sum: 1 }

      }
      }
      ] )

      My question is that db.orders.count() gives me the same answer. A lot simpler.

      Attachments

        Activity

          People

            Unassigned Unassigned
            deepaksharmaocp Deepak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 24 weeks ago