ParallelScan Return Type

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: API
    • Environment:
      Windows x64
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hi, I'm new here and to MongoDB so please excuse me if this has been asked before, I tried to find similar questions / issues. I'm attempting to use the ParallelScan method in the C# official driver and noticed a couple of things. First, the example on the website is not c#, I don't know what language it is, but C# requires values to be initialized in a for loop.

      for (int c = 0; c < cursors.Count(); c++ ){}

      would be more accurate. Next is the return type, it appears to be a ReadOnlyCollection of type BsonDocument. Wouldn't it make more sense if this returned a MongoCollection that could be further iterated through with the recommended foreach structure? As it is I get back a massive Bson document with the contents of every document that the cursor returned. If I want to do anything with the elements I would have to parse it like a CSV or something strange. If it returned a MongoCollection, or pseudoMongoCollection then a standard ForEach (BsonDocument ... would let you grab individual elements from each returned document...

      Again I apologize if I am completely off base here, I don't claim to be a developer, just a guy trying to use some really cool code that you've developed.

      Kind Regards

      /W

            Assignee:
            Unassigned
            Reporter:
            Wolfie Wolf [X]
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: