bonsaidb
bonsaidb copied to clipboard
Support retrieivng mapped/projected data from a document
We should offer a way to return data that is a query within the documents.
My current thoughts on this is to adopt an approach similar to GraphQL. A simple "Queryable" trait that allows a collection to respond to individual field queries, and a "Mutable" trait that allows mutation operations to be written.
When designing the traits, we should consider how a proc-macro could be used to generate the traits automatically by annotating a type with the extra information needed.
As per Discord, a proc-macro that allowed mapping/projecting data would also be able to provide basic View code generation.