I have a database which have approx 600000 records.
I 'm using the sails.js but
when I'm fetching the data with waterline approach It takes very long time to fetch 600000 records (approx 17sec) and It has limited query i.e It doesn't have Accessing Join Tables. so I join take the result of two query and then filter the data that's by It take lot's of time.
So I decided to use MongoDB with sails instead of waterline and I'm wondering if I can somehow use the Blueprint API without being linked to a Waterline model.
How to use the MongoDB instead of the waterline?
If you want to use the Sails models api, you can overwrite the blueprint methods in the controller.
So to overwrite, say,
UserModel, create the following functions inUserController.js:findwill override'get api/v1/user'createwill override'post api/v1/user'updatewill override'put api/v1/user'destroywill override'delete api/v1/user'Once inside the controller, you can run a
nativequery onMongolike so:In UserControllelr.js
Hope this helps.