VulcanJS / vulcan-npm

The full-stack JavaScript App Framework
https://vulcan-docs.vercel.app
MIT License
30 stars 8 forks source link

Update Next to use Mongo selector instead of Mongoose #130

Open eric-burel opened 2 years ago

eric-burel commented 2 years ago

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 commented 1 year ago

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.