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,
User
Model, create the following functions inUserController.js
:find
will override'get api/v1/user'
create
will override'post api/v1/user'
update
will override'put api/v1/user'
destroy
will override'delete api/v1/user'
Once inside the controller, you can run a
native
query onMongo
like so:In UserControllelr.js
Hope this helps.