Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1126

collection::distinct return should allow iteration over results

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: API
    • Major Change

      Currently, mongocxx::collection::distinct returns a mongocxx::cursor that provides a single document, the database reply document for the 'distinct' command. This is not in the spirit of the CRUD spec, which requires an iterator over the distinct values.

      Possible options:

      • Return a bsoncxx::array::value with the distinct keys as elements
      • Return a (synthesized) mongocxx::cursor over documents like this:
      // for keys a .. z
      { "key": "a" }
      { "key": "b" }
      ...
      { "key": "z" }
      

      Ideally, SERVER-3141 would get spec'd with a document format that we could emulate until it's implemented server-side as a command cursor.

            Assignee:
            Unassigned Unassigned
            Reporter:
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: