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

Allow sorting on subdocuments

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Linq
    • None

    Description

      Equivalent of doing something like this

      db['terryberry-AwardProviderProduct'].find({}).sort({"AwardCategoryPaths.Title": 1})
      

      Can't do this when I am doing this

        var query = from p in Db.GetCompanyCollection<AwardProviderProduct>(companyIdentifier).AsQueryable()
                              join o in Db.GetGlobalCollection<Product>() on p.Sku equals o.Sku
                              orderby p.AwardCategoryPaths[0].Title
                              select new AwardProviderProduct()
                              {
                                  Guid = p.Guid == Guid.Empty ? o.Guid : p.Guid,
                                  Reference = p.Reference,
                                  AwardCategoryPaths = p.AwardCategoryPaths ?? o.AwardCategoryPaths,
                                  Sku = p.Sku,
                                  Title = p.Title ?? o.Title,
                                  Description = p.Description ?? o.Description,
                                  AwardProviderReferenceId = p.AwardProviderReferenceId,
                                  Modifiers = p.Modifiers,
                                  Components = p.Components ?? o.Components,
                                  ImageUrl = p.ImageUrl ?? o.ImageUrl
                              };
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dcumings@terryberry.com Dan Cumings
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: