MODIFY SORTING FUNCTION FROM MONGODB

Job ID: 31420341

Budget: €30 – €250 EUR

hello everyones, i am working on a food table's data ( 3600 elements in my database with each of them 60 datas). I already did all request with redux on react, filtering, sorting, fetching datas are all ok. But i have 2 PROBLEMS : first the .sort() from MONGO is working like this [ 0, 1, 2,2223, 3, 457789, 555,6,7....] that is not a sorting which i can use. so i need add INSIDE my database a function making a sorting working more logically like : [ 0,1,2,3...11,12....110,120,300.... ]

OTHER PROBLEM, queries are slow, each time i make a filter, sorting... the server make new request to data base and will index 3186 elements from his ELEMENT ID (_id) so i do not understand, as is called by index why it takes 2 or 3 seconds each time to load the content.

i am developper and need advices in change of hour salary
Related categories: JavaScript NoSQL Couch & Mongo Node.js React.js MongoDB