brickyang / egg-mongo-native

MongoDB egg.js plugin using native driver.
MIT License
75 stars 11 forks source link

Please update @types/mongodb to v0.3.19 #34

Closed windmemory closed 5 years ago

windmemory commented 5 years ago

I found a bug that for @types/mongodb v0.3.17 that the Condition type has a required field $where, which doesn't make any sense.

I was trying to do a $pull operation on mongodb, but it asks me to add a $where clause inside the $pull, otherwise the ts will throw error and not compiling the code.

And this bug is fixed in v0.3.19, so please update it :)

brickyang commented 5 years ago

It isn't "@types/mongodb": "^3.1.17" in package.json?

^ means to install the latest version under the major version. For more details please check instruction of npm semver and package.json file.

windmemory commented 5 years ago

I agree with you, it should use the latest version of @types/mongodb, but it doesn't in my repository. I don't know the exact reason, and my workaround fix is install it myself.

I filed an issue here just want to record what I encountered and how I solved my problem.

I do like this plugin more than the egg-mongoose, so try to provide some useful info here.

:)

brickyang commented 5 years ago

Then what exact version has been installed in your repo?

windmemory commented 5 years ago

with only this package egg-mongo-native installed, I got 3.1.17

brickyang commented 5 years ago

I will see if I can reproduce it.