Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions extensions/MongoDbAtlas/MongoDbAtlas/MongoDbAtlasStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public async Task WriteFileAsync(
{ "_id", id },
{ "documentId", documentId },
{ "fileName", fileName },
{ "content", new BsonString(await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false)) }
{ "content", new BsonString(await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false)) },
{ "contentType", Pipeline.MimeTypes.PlainText}
};
await this.SaveDocumentAsync(index, id, doc, cancellationToken).ConfigureAwait(false);
}
Expand All @@ -94,6 +95,7 @@ public async Task WriteFileAsync(
doc["documentId"] = documentId;
doc["fileName"] = fileName;
doc["content"] = content;
doc["contentType"] = Pipeline.MimeTypes.PlainText;
await this.SaveDocumentAsync(index, id, doc, cancellationToken).ConfigureAwait(false);
}
else
Expand All @@ -105,7 +107,8 @@ public async Task WriteFileAsync(
{
{ "index", index },
{ "documentId", documentId },
{ "fileName", fileName }
{ "fileName", fileName },
{ "contentType", (new Pipeline.MimeTypesDetection()).GetFileType(fileName)}
}
};

Expand Down