Ask Your Question
2

The error message TS2724 in ../@types/mongodb/index.d.ts:35:18 suggests that there is no export member named 'ObjectID' in the module 'bson'. It proposes 'ObjectId' as a possible alternative.

asked 2023-02-27 11:00:00 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-06-08 11:00:00 +0000

plato gravatar image

This means that in the TypeScript definition file for MongoDB, the module 'mongoose' is trying to use an export member named 'ObjectID' from the module 'bson', but this member doesn't exist. The error message suggests that you might have misspelled it and meant to use 'ObjectId' instead.

To fix this error, you should update your code to use 'ObjectId' instead of 'ObjectID'. If you're not sure where this error is coming from, you can look at the TypeScript definition file mentioned in the error message and search for uses of 'ObjectID'.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-02-27 11:00:00 +0000

Seen: 12 times

Last updated: Jun 08 '21