Open wiseaidev opened 2 years ago
I think you are supposed to be using EmbeddedJsonModel inside a JsonModel. HashModel might work for storing, but isn't the recommended approach.
So, I'm not surprised they haven't added support for that yet.
Added #462 to track
Storing works, but querying doesn't work. Take the following as an example:
Running the above code
uvicorn your_file_name:router --reload
will generate the following exception:Is there any way to index such a field?
Edit
Another question related to a field that contains a list of
HashModel
instances like the following:Quoting from the docs:
So, it seems like it is not possible to store lists of
HashModel
. However, i built some custom logic to dynamically build a list from all the records. Another workaround would be to store the emails of users in the contact rather than a user reference:I think this would work, however it stores redundant information. The efficient way, i believe, is to store a reference for each user, a
HashModel
instance.