bonsaidb icon indicating copy to clipboard operation
bonsaidb copied to clipboard

Add ability to retrieve associated documents through reduce_grouped

Open ecton opened this issue 3 years ago • 0 comments

We should be able to reduce a view, grouping by the keys, and retrieve a list of documents that contributed to that reduced value.

After today's refactoring (af62a03e9582b46376879415ffc4b00358733b04), I'm pretty sure we can add two new ways to query views:

  • reduce_grouped_with_docs() -> MappedDocuments<OwnedDocument, V>
  • reduce_grouped_with_collection_docs() -> MappedDocuments<CollectionDocument<V::Collection>, V>

We should add examples to the Collection docs, the view-examples example, and if #168 is completed, add an example there too.

Suggested by @colelawrence in Discord

ecton avatar Feb 04 '22 00:02 ecton