|
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.
|