Cosmos DB converts arrays and objects into string format

Alexey Mavrin 0 Reputation points
2024-01-15T21:00:13.2766667+00:00

Hello. I've faced with interesting issue while using Cosmos DB. I use the database about a month and everything was fine until last Friday and I got a problem with my python application using Cosmos DB. I started to browse documents in database and found out that some fields were converted from arrays and objects into strings and all quotes were removed from original values and keys. For instance original field stored an object like {"name": "John"} after the issue the field contains {name:John} as a string type. Could you provide any possible reasons of the issue?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,762 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Alexey Mavrin 0 Reputation points
    2024-01-16T18:53:21.9266667+00:00

    Thanks for your answers. The most interesting thing is the issue affected 3 databases and one of them was no used since I started to use Cosmos DB. I'd like to notice that there weren't any problems with the same code while using Contoso. The types is correct, I use pydantic to validate data types. Unfortunately I can't provide code because of the project owned by my company and there's a lot of code to paste it here. I just do not understand how it has happened and why quotes were removed from original data. For now we removed broken databases and migrate ones from contoso one more time. It's ok in the present time but I worry if the problem will come out again.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.