diff --git a/test/types/populate.test.ts b/test/types/populate.test.ts index 95d0d2f1a58..41a2b7775cd 100644 --- a/test/types/populate.test.ts +++ b/test/types/populate.test.ts @@ -323,3 +323,17 @@ async function gh11955() { populatedParent.children.find(({ name }) => console.log(name)); } + +function gh12136() { + type ChildDocument = Child & Document; + type ParentDocument = Parent & Document; + + class Child { + parent: PopulatedDoc; + } + + class Parent { + child: PopulatedDoc; + } + +} diff --git a/types/index.d.ts b/types/index.d.ts index 084b69296fc..358c48f51a0 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -459,7 +459,7 @@ declare module 'mongoose' { $pop?: AnyKeys & AnyObject; $pull?: Mutable>; $push?: Mutable>; - $pullAll?: mongodb.PullAllOperator; + $pullAll?: AnyKeys & AnyObject; /** @see https://docs.mongodb.com/manual/reference/operator/update-bitwise/ */ $bit?: Record;