lihaibh / ditto

NPM library that helps managing MongoDB snapshots easily and efficiently
https://www.npmjs.com/package/mongodb-snapshot
MIT License
48 stars 6 forks source link

Please Keep Update Package #27

Open rupamking1 opened 3 years ago

rupamking1 commented 3 years ago

Please Keep Update Package

lihaibh commented 3 years ago

Do you have any feature request or bug report?

danielehrhardt commented 3 years ago

node_modules/mongodb-snapshot/dist/connectors/mongodb/MongoDBDuplexConnector.d.ts:2:10 - error TS2305: Module '"mongodb"' has no exported member 'FilterQuery'.

2 import { FilterQuery } from "mongodb";
           ~~~~~~~~~~~
node_modules/mongodb-snapshot/dist/connectors/mongodb/MongoDBDuplexConnector.d.ts:79:114 - error TS2694: Namespace '"/Users/danielehrhardt/projects/mefra/accounting-api/node_modules/mongodb/mongodb"' has no exported member 'BulkWriteOpResultObject'.

79     writeCollectionDocuments(collectionName: string, documents: [CollectionDocument]): Promise<import("mongodb").BulkWriteOpResultObject>;
                                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~

Found 2 error(s).
lihaibh commented 3 years ago

@danielehrhardt are you trying to compile this library or just using it?

danielehrhardt commented 3 years ago

@danielehrhardt are you trying to compile this library or just using it?

Just using it

lihaibh commented 3 years ago

@danielehrhardt are you running the program as ts-node or node? can you give more details?

garrappachc commented 2 years ago

I've the same issue, it appeared with mongoose update: https://github.com/tf2pickup-org/server/pull/1263/checks?check_run_id=3875208722

lihaibh commented 2 years ago

@garrappachc how can we fix it? can you open a pull request?

garrappachc commented 2 years ago

It's a matter of mongodb changing its API, thus mongodb-snapshot is not compatible with version 4 and above. This line, for example, imports FilterQuery that no longer exists.

lihaibh commented 2 years ago

@garrappachc basically it just types and im not exporting it, so i wonder if by using "any" i can resolve this issue. Maybe we should upgrade only "@types/mongodb" on package.json? The library is meant to support both mongodb v3 and v4.