Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1700

Add dateOperator extensions

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Done
    • Affects Version/s: 2.2.4
    • Fix Version/s: None
    • Component/s: Feature Request
    • Labels:
      None

      Description

      when using grop/project phase I'd to have ability to use typed extension instead of passing bson document

      var project =
      BsonDocument.Parse(
      "{Key:1, Timestamp:1, year:{$year:'$Timestamp'}, dayOfYear:{$dayOfYear:'$Timestamp'}}");
      var group = BsonDocument.Parse("{_id:

      {year:'$year', dayOfYear:'$dayOfYear'}

      , count:{$sum:1}}");
      var result = collection.Aggregate().Project(project).Group(group).ToList();

      in this case i will expect that project will look like this:

      .Project(i => new

      { i.Key, dayOfYear = i.Timestamp.GetDayOfYear, year = i.Timestamp.GetYear }

      ):

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: