Skip to content

feat(NODE-5590): deprecate GridFS fields #3905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions src/gridfs/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ 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 */
Expand Down
10 changes: 8 additions & 2 deletions src/gridfs/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
}

Expand Down