Skip to content

test(NODE-3237): migrate legacy spec tests to unified format #4180

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 10 commits into from
Jul 19, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 27 additions & 1 deletion src/gridfs/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,41 @@ export interface GridFSFile {

/** @internal */
export interface GridFSBucketReadStreamPrivate {
/**
* The running total number of bytes read from the chunks collection.
*/
bytesRead: number;
/**
* The number of bytes to remove from the last chunk read in the file. This is non-zero
* if `end` is not equal to the length of the document and `end` is not a multiple
* of the chunkSize.
*/
bytesToTrim: number;

/**
* The number of bytes to remove from the first chunk read in the file. This is non-zero
* if `start` is not equal to the 0 and `start` is not a multiple
* of the chunkSize.
*/
bytesToSkip: number;

files: Collection<GridFSFile>;
chunks: Collection<GridFSChunk>;
cursor?: FindCursor<GridFSChunk>;

/** The running total number of chunks read from the chunks collection. */
expected: number;
files: Collection<GridFSFile>;

/**
* The filter used to search in the _files_ collection (i.e., `{ _id: <> }`)
* This is not the same filter used when reading chunks from the chunks collection.
*/
filter: Document;

/** Indicates whether or not download has started. */
init: boolean;

/** The expected number of chunks to read, calculated from start, end, chunkSize and file length. */
expectedEnd: number;
file?: GridFSFile;
options: {
Expand Down
7 changes: 1 addition & 6 deletions src/operations/find_and_modify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,7 @@ export class FindAndModifyOperation extends CommandOperation<Document> {
...this.cmdBase
};

// Have we specified collation
try {
decorateWithCollation(cmd, coll, options);
} catch (err) {
return err;
}
decorateWithCollation(cmd, coll, options);

if (options.hint) {
// TODO: once this method becomes a CommandOperation we will have the server
Expand Down
Loading