Possam
Possam

Reputation: 376

Cosmos DB apply changes to existing data

I'm using Cosmos DB in an attempt to keep a Web App as cheap / free as possible. I'm not very familiar with it. I've added a bunch of data. Approx 200 rows in a table called Members. I then added more fields. In particular this field

public bool ArchiveMember { get; set; }

Any new Members I add have the ArchiveMember field, but existing data doesn't include the new field (set as false) as I expected. Is there a way of applying migrations to all data?

Upvotes: 0

Views: 350

Answers (1)

AjayKumarGhose
AjayKumarGhose

Reputation: 4893

Thank you rickvdbosch ,Posting your comment as an answer to help other community members for this similar issue.

"You should update the data yourself using a script or tool. It might be simpler to have the entity have a default value for the ArchiveMember property instead of updating all data. You could also take a look at Table Storage which is a feature of Storage Accounts. The API is also supported by Cosmos DB, enabling you to start with a storage account and migrate over if requirements or performance change."

Upvotes: 1

Related Questions