Difference between Client.CreateDocumentAsync( ) and documents.AddAsync( );

Viewed 196

I have one Azure Function which is adding documents to cosmos db. One way of adding is by creating a cosmos client and then calling client.CreateDocumentAsync( ) and other is creating an Output binding to Azure Function with IAsyncCollector documents and then calling documents.AddAsync().

I would like to know what's the difference between these two and which one is more preferable.

Thanks

1 Answers

Two main differences:

Related