DenoDDeno
Powered by
XiΓ  πŸ‡΅πŸ‡ΈX
Denoβ€’2y agoβ€’
5 replies
XiΓ  πŸ‡΅πŸ‡Έ

Mongoose Type Error

This is my mongodb connection code
await mongoose.connect("mongodb://127.0.0.1:27017", {
  autoIndex: false,
  retryWrites: true,
})
await mongoose.connect("mongodb://127.0.0.1:27017", {
  autoIndex: false,
  retryWrites: true,
})

But the problem is Deno showing this error:
Argument of type '{ autoIndex: false; retryWrites: true; }' is not assignable to parameter of type 'ConnectOptions'.
  Type '{ autoIndex: false; retryWrites: true; }' is missing the following properties from type 'ConnectOptions': family, hints, localAddress, localPort, lookupdeno-ts(2345)
(property) ConnectOptions.autoIndex?: boolean | undefined
Set to false to disable automatic index creation for all models associated with this connection.
Argument of type '{ autoIndex: false; retryWrites: true; }' is not assignable to parameter of type 'ConnectOptions'.
  Type '{ autoIndex: false; retryWrites: true; }' is missing the following properties from type 'ConnectOptions': family, hints, localAddress, localPort, lookupdeno-ts(2345)
(property) ConnectOptions.autoIndex?: boolean | undefined
Set to false to disable automatic index creation for all models associated with this connection.


What's the problem? In node we can modify the mongoose connection options but what's the problem here?

In our team we heavily relay on Mongoose and Redis and Kafka, Stripe, NodeMailer. I'm trying to implement our back-end now on Deno.


Can anyone ensure me that all those packages will work properly with deno? In previous I've tried to do this but face a lot's of problem. But this time I am trying again.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Error connecting to mongoose when using deno cli
CesarCCesar / help
3y ago
Problem with Mongoose + auth
Jess182JJess182 / help
4y ago
Deno cannot use ErrorEvent Type from @types/ws
BlouflashBBlouflash / help
15mo ago