Closed jblevins1991 closed 4 years ago
Right now if you look at insertOne's documentation, the doc argument is the document to insert. In your index.d.ts file the doc argument is an entire schema. This does not align with the spec for insertOne.
insertOne
insertOne from index.d.ts:
insertOne(docs: OptionalId<TSchema>, callback: MongoCallback<InsertOneWriteOpResult<WithId<TSchema>>>): void; insertOne(docs: OptionalId<TSchema>, options?: CollectionInsertOneOptions): Promise<InsertOneWriteOpResult<WithId<TSchema>>>; insertOne(docs: OptionalId<TSchema>, options: CollectionInsertOneOptions, callback: MongoCallback<InsertOneWriteOpResult<WithId<TSchema>>>): void;
I believe you're looking at types coming from @types/mongodb
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/mongodb/index.d.ts#L1114
You are correct. ✌️
Right now if you look at insertOne's documentation, the doc argument is the document to insert. In your index.d.ts file the doc argument is an entire schema. This does not align with the spec for
insertOne
.insertOne from index.d.ts: