From c130ab68bfbc8f0594f42aa2605b70d3174a0c82 Mon Sep 17 00:00:00 2001 From: Alena Khineika Date: Mon, 30 Oct 2023 17:19:18 +0100 Subject: [PATCH 1/2] feat(NODE-5590): deprecate GridFS fields --- src/gridfs/download.ts | 10 ++++++++-- src/gridfs/upload.ts | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gridfs/download.ts b/src/gridfs/download.ts index 6736b968f15..5ec47db98a7 100644 --- a/src/gridfs/download.ts +++ b/src/gridfs/download.ts @@ -44,10 +44,16 @@ export interface GridFSFile { length: number; chunkSize: number; filename: string; - contentType?: string; - aliases?: string[]; metadata?: Document; uploadDate: Date; + /** + * @deprecated Will be removed in the next major version. + */ + contentType?: string; + /** + * @deprecated Will be removed in the next major version. + */ + aliases?: string[]; } /** @internal */ diff --git a/src/gridfs/upload.ts b/src/gridfs/upload.ts index 9feb8141581..2f3ad9c177f 100644 --- a/src/gridfs/upload.ts +++ b/src/gridfs/upload.ts @@ -26,9 +26,15 @@ export interface GridFSBucketWriteStreamOptions extends WriteConcernOptions { id?: ObjectId; /** Object to store in the file document's `metadata` field */ metadata?: Document; - /** String to store in the file document's `contentType` field */ + /** + * String to store in the file document's `contentType` field. + * @deprecated Will be removed in the next major version. Add a contentType field to the metadata document instead. + */ contentType?: string; - /** Array of strings to store in the file document's `aliases` field */ + /** + * Array of strings to store in the file document's `aliases` field. + * @deprecated Will be removed in the next major version. Add an aliases field to the metadata document instead. + */ aliases?: string[]; } From d332dcf936f0162660b900a4a69698958b70e76c Mon Sep 17 00:00:00 2001 From: Alena Khineika Date: Tue, 31 Oct 2023 15:58:34 +0100 Subject: [PATCH 2/2] style: deprecation notice as one line --- src/gridfs/download.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gridfs/download.ts b/src/gridfs/download.ts index 5ec47db98a7..dc2cbfd90ff 100644 --- a/src/gridfs/download.ts +++ b/src/gridfs/download.ts @@ -46,13 +46,9 @@ export interface GridFSFile { filename: string; metadata?: Document; uploadDate: Date; - /** - * @deprecated Will be removed in the next major version. - */ + /** @deprecated Will be removed in the next major version. */ contentType?: string; - /** - * @deprecated Will be removed in the next major version. - */ + /** @deprecated Will be removed in the next major version. */ aliases?: string[]; }