1
votes

I am trying to write a record with a different schema to an existing collection with records . I don't get a exception, but i don't see the new record. Do I need to use a different collection?

       DocumentDBRepository<ScheduleViewModel>.CreateItemAsync(task).GetAwaiter();
1
Could you give an example of a record that does work and one that currently doesn't? I presume the new record is including the relevant fields e.g. a partition key? - James
you can create a record without a partition key in cosmos db even if the collection has partition key set, so that shoudln't be a problem - 4c74356b41
@4c74356b41 hmm, that's news to me, I could've sworn this previously wasn't allowed. - James
i had the same impression, but it works - 4c74356b41
@4c74356b41 yep I gave it a go myself, not sure how that works, I guess Cosmos must just create a null logical partition. - James

1 Answers

0
votes

Cosmos DB doesn't care about what you put into to it (as almost any other nosql db), so this is supported from the Cosmos DB perspective. from the code perspective, I suppose you need to create a connection that would support the model your are using and create a document