Closed max-frai closed 5 years ago
Hey there!
I'm curious, what's the use-case or mindset behind wanting a heterogeneous collection? Collections in Avocado are intentionally homogeneous. It's quite hard to make a bulletproof implementation for a collection that may hold any type (and additional questions arise, such as what should the name be for each instantiation).
In the meantime, I suggest that you could use a non-generic document struct and an enum wrapping the different possible types. (Of which there should be a finite, closed set – as far as I can tell, trying to store any possible future types in a database doesn't really make sense.)
Hello! Sorry for long request. You are right, there is no sense in such situation.
Hi! Thanks again for amazing wrapper :) I found, that it's not possible to derive
Doc
for generic structure:We specify
Output
type for queries, maybe we also can specify somehow exact types for deserialization?