Hi @zookzook, thanks one more time for maintaining this library and merging my contributions!
I'm not sure yet what's the use for the types when defining a module with use Mongo.Collection. Is it just for documentation/humans?
There doesn't seem to be any form of validation, nor does it seem to influence the default encoding/decoding process (and I'm okay with that).
Nonetheless, I noticed that calling SomeCollection.__collection__(:types) includes some info about a document attribute set with embeds_many, but missed a similar attribute set with embeds_one.
In embeds_many the type is derived as type = unquote(Macro.escape({{:., [], [mod, :t]}, [], []})). I'm not sure what would be expected for the embeds_one case, any advice?
Hi @zookzook, thanks one more time for maintaining this library and merging my contributions!
I'm not sure yet what's the use for the types when defining a module with
use Mongo.Collection
. Is it just for documentation/humans?There doesn't seem to be any form of validation, nor does it seem to influence the default encoding/decoding process (and I'm okay with that).
Nonetheless, I noticed that calling
SomeCollection.__collection__(:types)
includes some info about a document attribute set withembeds_many
, but missed a similar attribute set withembeds_one
.https://github.com/zookzook/elixir-mongodb-driver/blob/6071f18eeabffab634db509f85a734ddcf9eb2a6/lib/mongo/collection.ex#L888-L894
https://github.com/zookzook/elixir-mongodb-driver/blob/6071f18eeabffab634db509f85a734ddcf9eb2a6/lib/mongo/collection.ex#L905-L911
In
embeds_many
the type is derived astype = unquote(Macro.escape({{:., [], [mod, :t]}, [], []}))
. I'm not sure what would be expected for theembeds_one
case, any advice?