-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cosmos: Support for weakly typed json #20584
Comments
@AndriySvyryd I can't find the dupe for this. |
I did a lot of searching for dups myself before creating this :). I found similar issues, but all were vague or had replies of the sort saying this would be great but we need to wait until the other providers solve this first. Now that another provider has taken the initiative on picking a solution, hopefully it's a good time to go forward with this provider as well! |
Thanks for considering this! FromSql would work OK for reads but not well/at all for updates and creates, and a custom serializer wouldn't work for our specific use case (we already tried it) due to our use of dynamic JSON (we have a JSON object with string keys and arbitrary object values -- basically Dictionary<string, JObject>) |
I assume this is dependent on #18753, since JsonDocument is from STJ which Microsoft.Azure.Cosmos switches to in v4. |
Agreed! This would be a great feature. |
It woud be nice if we could use HasConversion to return pure json and viceversa. |
Note from triage: this needs to be done in conjunction with or after #17306. |
We should consider exposing this through Dictionary<string, object> or any type with a compatible indexer property instead of depending on a specific DOM implementation. |
Currently there's no good way in EF Core to work with fields in Cosmos that can contain arbitrary JSON. We would love a way to both read and write to fields like that.
The Npgsql provider appears to have elegantly solved this by adding support for JsonDocument column types (ref: http://www.roji.org/efcore-pg-advanced-json#weakly-typed-access-via-jsondocument). Having matching functionality with the Cosmos provider would be exactly what we need.
The text was updated successfully, but these errors were encountered: