Skip to content

Commit 4c9d190

Browse files
committed
effect-mongodb: export internal Filter type (close #48)
1 parent 17e6368 commit 4c9d190

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.changeset/spotty-days-smoke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"effect-mongodb": minor
3+
---
4+
5+
Export internal Filter type to allow it to be used by clients

packages/effect-mongodb/src/Collection.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import type {
3838
} from "mongodb"
3939
import * as AggregationCursor from "./AggregationCursor.js"
4040
import * as FindCursor from "./FindCursor.js"
41-
import type { Filter } from "./internal/filter.js"
41+
import type { Filter as Filter_ } from "./internal/filter.js"
4242
import type { ModifyResult } from "./internal/modify-result.js"
4343
import { mongoErrorOrDie } from "./internal/mongo-error.js"
4444
import * as SchemaExt from "./internal/schema.js"
@@ -69,6 +69,7 @@ export class CollectionImpl<A extends Document, I extends Document = A, R = neve
6969
}
7070

7171
export type FindOptions = Omit<MongoFindOptions, "projection">
72+
export type Filter<TSchema> = Filter_<TSchema>
7273

7374
export const find: {
7475
<I extends Document>(

packages/effect-mongodb/src/FindCursor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import * as Schema from "effect/Schema"
1212
import * as Stream from "effect/Stream"
1313
import * as Tuple from "effect/Tuple"
1414
import type { Document, FindCursor as FindCursor_, Sort, SortDirection } from "mongodb"
15-
import type { Filter } from "./internal/filter.js"
15+
import type { Filter as Filter_ } from "./internal/filter.js"
1616
import { mongoErrorOrDie } from "./internal/mongo-error.js"
1717
import * as MongoError from "./MongoError.js"
1818

@@ -34,6 +34,8 @@ export class FindCursorImpl<A, I = A, R = never> extends Data.TaggedClass("FindC
3434
}
3535
}
3636

37+
export type Filter<TSchema> = Filter_<TSchema>
38+
3739
export const filter: {
3840
<I extends Document>(filter: Filter<I>): <A, R>(cursor: FindCursor<A, I, R>) => FindCursor<A, I, R>
3941
<A, I extends Document, R>(cursor: FindCursor<A, I, R>, filter: Filter<I>): FindCursor<A, I, R>

0 commit comments

Comments
 (0)