Comments (7)
Do you have
mongodb
in yourpackage.json
dependencies or devDependencies?
I tried doing npm i mongodb
, it just added mongodb to my dependencies, but of course it didn't download anything, because I already have the latest version in my node_modules thanks to connect-mongo. Either way, with or without mongodb in my package.json, the issue remains.
from mongoose.
Try running npm i [email protected]
from mongoose.
This looks to be expected behavior because for some reason connect-mongo is installing [email protected]
but Mongoose has [email protected]
. Are you using npm, yarn, something else?
from mongoose.
Are you using npm, yarn, something else?
npm
from mongoose.
I don't know why typescript doesn't like it. I've read declaration files for both (node_modules/mongodb/mongodb).MongoClient
and (node_modules/mongoose/node_modules/mongodb/mongodb).MongoClient
. They look identical.
I did this for now to get rid of that:
declare module 'mongoose' {
interface Connection {
getClient(): import('mongodb').MongoClient;
}
}
from mongoose.
Do you have mongodb
in your package.json
dependencies or devDependencies?
from mongoose.
Try running
npm i [email protected]
Idk why I didn't come up with this one before. Worked like a charm. Thank you!
from mongoose.
Related Issues (20)
- TypeScript does not return an error when assigning the result of a `lean` query to a variable of type `InstanceType<Model<MyModel>>` HOT 4
- Unreported breaking change - insertMany with lean option HOT 1
- _id: null on returned document when using .create() or .save() HOT 2
- Mongoose randomly does not reconnect on primary change/restart HOT 3
- Clarifications regarding idle socket connections HOT 1
- Sorting with equality does not ensure order in pagination HOT 3
- mongoose insertMany 30x slower than mongodb insertMany in some cases HOT 1
- Model.bulkSave() and setting the query with "save" and "bulkWrite" pre middleware causes path conflict HOT 1
- Validators not working even when explicitly switched on HOT 1
- Question: with Middleware or Plugins, is it possible to execute queries using a separate mongoose connection? HOT 2
- Improve readyState behavior to more reliably report connection state
- Type 'ChangeStreamOptions & { writeConcern?: never; }' is not assignable to type 'ChangeStreamOptions'. HOT 8
- Support for non-transactional operations in asynclocalstorage transactions
- transactionAsyncLocalStorage not honored in bulk operations like insertMany
- Library Type Matching Issue on WebStorm HOT 3
- Optional Arguments in SchemaTypes.path().cast required by Typescript
- Mongoose potentially fails to disconnect from mongod when used with pm2 HOT 1
- $switch in $expr in filter query failed: Cannot read properties of undefined (reading 'map') HOT 2
- bulkWrite operations on any sharded collection are completely broken in 8.4.1+
- Mongoose is creating ghost/empty collections for every database under a project where multiple schemas are used HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose.