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

OData $expand and $top query options together with PageSize throws a MongoDB.Driver.MongoQueryException

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1
    • Affects Version/s: 1.9.1
    • Component/s: Linq
    • Labels:
      None
    • Environment:
      .NET 4.5

      I have a OData controller with Get action which has a QueryableAttribute with set PageSize property:

      [Queryable(PageSize=5000)]
      public async Task<IHttpActionResult> Get([FromODataUri] Guid key)

      { return this.Ok(repository.All()); }

      repository.All() - returns MongoQueryable

      when I make a GET request to my OData controller with following query:
      ?$expand=Attributes&$top=10

      I get MongoDB.Driver.MongoQueryException exception with message:
      Skip and Take may only be used in conjunction with each other and cannot be separated by other operations.

      If I remove $top or $expand option from my request or remove PegeSize from QueryableAttribute then I get successful response

            Assignee:
            Unassigned Unassigned
            Reporter:
            dimitar.moev@schneider-electric.com Dimitar Moev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: