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

Document how to project (aggregation) day/month/year from an ISODate field using the Java driver

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • drivers
    • None

    Description

      Please document how to project day/month/year from an ISODate field using the Java driver. The customer attached to this docs ticket had difficulty figuring out how to do this and so did I

      For example:

      Document project = Document.parse("{$project: {year: {$dateToString: {format: '%Y', date: '$Events.eventTime'}}}}");
      

      Thanks,
      Angela.

      Attachments

        Activity

          People

            Unassigned Unassigned
            angela.morgan Angela Morgan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              3 years, 2 weeks, 1 day ago