Skip to content

Commit

Permalink
fix: skip options bug in countDocuments method
Browse files Browse the repository at this point in the history
  • Loading branch information
erfanium committed Jul 10, 2022
1 parent 1c7148d commit 1dc6b7e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ export class MongoClient {
headers = new Headers();

constructor(
{ dataSource, auth, endpoint, fetch }: MongoClientConstructorOptions,
{ dataSource, auth, endpoint, fetch: customFetch }:
MongoClientConstructorOptions,
) {
this.dataSource = dataSource;
this.endpoint = endpoint;

if (fetch) {
this.fetch = fetch;
if (customFetch) {
this.fetch = customFetch;
}

this.headers.set("Content-Type", "application/ejson");
Expand Down Expand Up @@ -179,7 +180,7 @@ class Collection<T> {
}

if (typeof options?.skip === "number") {
pipeline.push({ $skip: options.limit });
pipeline.push({ $skip: options.skip });
}

if (typeof options?.limit === "number") {
Expand Down

0 comments on commit 1dc6b7e

Please sign in to comment.