Why do i get this typescript error when i create a typeless collection when i try to use $pull on the testCollection? When i use non-array functions like $find etc. it works fine. Do i have to type every Collection? How would it work with dynamic Collections-Documents?
public async foo()
{
let testCollection = Database.db.collection("test");
await testCollection.updateMany({ name:"foo" }, {
$pull: { ids: "bar" }
}).catch((error)=>{})
}
Type 'string' is not assignable to type 'never'.
I use mongodb@4.2.2 and typescript@3.7