in Microsoft.Azure.WebJobs.Extensions.AzureCosmosDb.Mongo/Binding/CosmosDBMongoBindingAsyncCollector.cs [26:47]
public async Task AddAsync(T item, CancellationToken cancellationToken = default(CancellationToken))
{
if (item == null)
{
throw new ArgumentNullException(nameof(item));
}
try
{
if (this._reference.createIfNotExists)
{
await InitializeCollection(this._reference);
}
await UpsertDocument(this._reference, item);
this._logger.LogDebug(Events.OnBindingDataAdded, "Document upserted successfully.");
}
catch (Exception ex)
{
this._logger.LogError(Events.OnBindingDataError, $"Error upserting document: {ex.Message}");
}
}