Skip to content
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

Update Next to use Mongo selector instead of Mongoose #130

Open
4 tasks
eric-burel opened this issue Jun 23, 2022 · 1 comment
Open
4 tasks

Update Next to use Mongo selector instead of Mongoose #130

eric-burel opened this issue Jun 23, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@eric-burel
Copy link
Collaborator

eric-burel commented Jun 23, 2022

  • Create a single Mongo Client instance and expose it somewhere
  • Pass this Mongo client whenever you create a connector
  • Improve "filterFunction" to support both Mongo and Mongoose via a generic type? A Mongo connector was created in Feature/mongo objectid #129 but types are not yet perfect
  • Duplicate tests created for mongooseConnector for mongoConnector

Contrary to Mongoose, Mongo node driver do not provide a global object. You have to create your own global client, that you can pass around to Vulcan, and connect it as usual in the "connectToAppDb" middleware everytime a serverless function is called (if its not yet connected of course).

@eric-burel
Copy link
Collaborator Author

This might be a bad idea in the end, Mongoose model system is way easier to use than Mongo driver, which forces you to wait for the db to be connected to access models, thus leading to a lot of value/context passing and inability to use the normal "import/export" system to access models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant