Rewrite: Added mongoose 4 / 5 compatibility #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello there,
i've achieved to adapt Tungus to work with newer mongoose incarnations as discussed in #15 , which ended in a full rewrite.
This has been tested in a bigger project and works pretty good on Windows and Linux.
The support of mongoose 3 has been dropped though (as I've never tested it with this rewrite / the API changed a lot on mongooses side AND the support has ended a while ago).
The current state of TingoDB works well in our bigger project. There might be some use cases, that need modifications to the TingoDB API, but in the most cases it does the job.
One thing needs to be patched in the TingoDB:
sergeyksv/tingodb#159
If it gets rejected, we could build a thin layer to wrap the returned object or you can just use my branch of TingoDB in your
package.json
.About the implementation:
It is kind of future proof, as it overrides all high level connection functions. This prevents connections to the MongoDB early and effective, also it is more independent form changes made in higher level functions. It suppresses some warnings, that do not apply to the TingoDB.
Also it mimics the mongoose
mongodb-native-driver
s behavior as closely as possible while staying true to the high level approach. This will hopefully make updates on mongoose work, without adaption.It was tested in "real life" on Windows 7 / 10 on x64 and Debian Linux on ARMv7.
Some things got fixed in order to work properly on Windows (symlinks etc.).
Feedback is welcome.
Regards, root-core.