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,
})

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.


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.
Was this page helpful?