-
Notifications
You must be signed in to change notification settings - Fork 0
feat: optimise and test code for various versions of MongoDB i.e. v3.4, v3.6, v4.0, v4.2 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rename max_id to nextId
…t manually initialised Fixes the reliance on initialising the assigner
…er instance. Use `MongooseIdAssigner Constructor` to get Instance. The interface `AssignerOptions` also changed, modelName not needed. Use `AssignerPluginOptions` when using with `schema.plugin(..., options)`.
* perf(pre-save): remove checks for `options.fields` as it never gets called * test: write some more test cases
* fix: flow parse of .json file in `config-chain` package * chore: add babel-jest, peer dependency to ts-jest
This helps reduce the weight of code, especially when you don't intend on using uuids as ids
…Instance` BREAKING CHANGE: `MongooseIdAssigner.plugin` will NOT return IdAssigner instance. It is intended to be used only with like so -> `schema.plugin(MongooseIdAssigner.plugin, options)`. Use `MongooseIdAssigner Constructor` to get Instance. It takes parameters `ModelInstance` and `AssignerOptions`. The interface `AssignerOptions` also changed, modelName not needed. Use `AssignerPluginOptions` when working with `schema.plugin(..., options)`.
@see Automattic/mongoose#5073 `pre-save` hooks not triggered if set after initialising model for mongoose >= 4.8.0, so all models whose Assigner was initialised using MongooseIdAssigner constructor will fail, but those with MongooseIdAssigner.plugin is ok.
…ead of hard-coding
…urns formatted Error
BREAKING CHANGE: @see Automattic/mongoose#5073 MongooseIdAssigner WILL NOT BE initialised using Models. Plugin can now only be used by calling `schema.plugin(MongooseIdAssigner, options)` or `schema.plugin(MongooseIdAssigner.plugin, options)` To get IdAssigner Instance, 1: Get from `localStateStore.getIdAssigner(schema)` 2: Use `const IA = MongooseIdAssigner.plugin(schema, options)` 3: Use `const IA = new MongooseIdAssigner(schema, options)`
Now test for Mongo v3, v4
…est db to __mgIdAss__
…have file error: UnhandledPromiseRejectionWarning: Error: Too small (243 bytes) mongod binary downloaded from https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-3.4.tgz @see typegoose/mongodb-memory-server#163
…Database undefined connection error
Its implemented in tsc ^2.9
🎉 This PR is included in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
mernxl
added a commit
that referenced
this pull request
Dec 5, 2019
…4, v3.6, v4.0, v4.2 Code base optimized and tested against MongoDB v3.4, v3.6, v4.0, v4.2 Node version v8, v10 and v12 There was an issue why publishing from previous pull #2 . Redo to ensure correct semver numbers set
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Code base optimized and tested against
This is same as #3