Skip to content

Commit 412ee2f

Browse files
authored
Fixes to type for _id in MongoDB documents return with $db.f (#223)
* The literal `false` gives an error when used as `_id` * Allow querying `_id` with full `#db.ObjectId` structure * Typo fix
1 parent 8ea4b63 commit 412ee2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

env.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,8 @@ type MongoTypeStringsToTypes = {
720720

721721
type MongoTypeString = keyof MongoTypeStringsToTypes
722722
type MongoTypeNumber = -1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 127
723-
type MongoId = Exclude<MongoPrimitive, null> | MongoObjectId | MongoObject
724-
type MongoQueryId = Exclude<MongoPrimitive, null> | MongoQueryObject
723+
type MongoId = Exclude<MongoPrimitive, null | false> | MongoObjectId | MongoObject
724+
type MongoQueryId = Exclude<MongoPrimitive, null | false> | MongoObjectId | MongoQueryObject
725725
type MongoDocument = MongoObject & { _id?: MongoId }
726726

727727
type MongoQueryType<TQuery extends MongoQueryObject> = {

0 commit comments

Comments
 (0)