none
Querying count of documents on single partition failes RRS feed

  • Question

  • Hello!

    I'm using Cosmos DB with MongoDB API, and there have a collection partitioned on accountId property. Anyway, whenever I try to execute such a query (this was from Robo3t)

    db.getCollection('Collection').find({"accountId" : "stringAccountId"}).count()

    I encounter an error which can be seen on the screenshot. The same happens when I execute a query with C# Mongo client. Any idea how to fix this?

    Wednesday, June 26, 2019 8:41 AM

All replies

  • Hi Andrew,

    Thanks for your feedback. I am trying to repro this issue. Would get back to you with the insights.

    In the meanwhile, Could you please share the code snippet you are using. That would be helpful in digging further.

    Wednesday, June 26, 2019 11:38 AM
    Moderator
  • Hi Angoyal,

    in my initial message I've included a query from Robo3T (https://robomongo.org/) I use and with which this issue can be reproduced. From C# client I use the code as the following (simplified as I can't copy project's code)

    private readonly IMongoCollection<CollectionItem> _mongoCollection;

    var query = Builders<CollectionItem>.Filter.Eq(vs => vs.AccountId, accountId);

    var queryRequest = _mongoCollection.Find(query);

    var totalResults = queryRequest.Count();

    The collection is partitioned by accountId

    Wednesday, June 26, 2019 11:52 AM
  • Hi,

    Any news available on this one?

    Friday, July 19, 2019 8:16 AM
  • Hi,

    For a deeper investigation and immediate assistance on this issue, if you have a support plan you may file a support ticket, else could you send an email to AzCommunity @ Microsoft dot com with the below details, we would like to work closer with you on this matter. 

    Thread URL:
    Subscription ID

    Thursday, August 1, 2019 6:35 AM
    Moderator
  • Hi,

    I hope your concern has been addressed with Azure support. It would be great if you could share the resolution as well. So that if anyone else is facing the same issue will be able to use the same resolution.

    Wednesday, August 14, 2019 9:24 AM
    Moderator