Skip to content

Commit

Permalink
test(NODE-3237): migrate legacy spec tests to unified format (#4180)
Browse files Browse the repository at this point in the history
Co-authored-by: Neal Beeken <neal.beeken@mongodb.com>

NODE-3211, NODE-3213, NODE-5975, NODE-5976, NODE-5984, NODE-6004, NODE-6005
  • Loading branch information
baileympearson committed Jul 19, 2024
1 parent 35d8840 commit 357ca08
Show file tree
Hide file tree
Showing 617 changed files with 78,492 additions and 44,576 deletions.
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

0 comments on commit 357ca08

Please sign in to comment.