Skip to content

Commit 357ca08

Browse files
test(NODE-3237): migrate legacy spec tests to unified format (#4180)
Co-authored-by: Neal Beeken <[email protected]> NODE-3211, NODE-3213, NODE-5975, NODE-5976, NODE-5984, NODE-6004, NODE-6005
1 parent 35d8840 commit 357ca08

File tree

617 files changed

+78492
-44576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

617 files changed

+78492
-44576
lines changed

src/gridfs/download.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,41 @@ export interface GridFSFile {
5656

5757
/** @internal */
5858
export interface GridFSBucketReadStreamPrivate {
59+
/**
60+
* The running total number of bytes read from the chunks collection.
61+
*/
5962
bytesRead: number;
63+
/**
64+
* The number of bytes to remove from the last chunk read in the file. This is non-zero
65+
* if `end` is not equal to the length of the document and `end` is not a multiple
66+
* of the chunkSize.
67+
*/
6068
bytesToTrim: number;
69+
70+
/**
71+
* The number of bytes to remove from the first chunk read in the file. This is non-zero
72+
* if `start` is not equal to the 0 and `start` is not a multiple
73+
* of the chunkSize.
74+
*/
6175
bytesToSkip: number;
76+
77+
files: Collection<GridFSFile>;
6278
chunks: Collection<GridFSChunk>;
6379
cursor?: FindCursor<GridFSChunk>;
80+
81+
/** The running total number of chunks read from the chunks collection. */
6482
expected: number;
65-
files: Collection<GridFSFile>;
83+
84+
/**
85+
* The filter used to search in the _files_ collection (i.e., `{ _id: <> }`)
86+
* This is not the same filter used when reading chunks from the chunks collection.
87+
*/
6688
filter: Document;
89+
90+
/** Indicates whether or not download has started. */
6791
init: boolean;
92+
93+
/** The expected number of chunks to read, calculated from start, end, chunkSize and file length. */
6894
expectedEnd: number;
6995
file?: GridFSFile;
7096
options: {

src/operations/find_and_modify.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,7 @@ export class FindAndModifyOperation extends CommandOperation<Document> {
192192
...this.cmdBase
193193
};
194194

195-
// Have we specified collation
196-
try {
197-
decorateWithCollation(cmd, coll, options);
198-
} catch (err) {
199-
return err;
200-
}
195+
decorateWithCollation(cmd, coll, options);
201196

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

0 commit comments

Comments
 (0)