-i have lots of data 6lkh up record and I fire find query with modelname.find({isDelete:false)} and indexing name field with will return also select name field. if user search the name then filter option like if
(body.search !== undefined && body.search !== null) {
filter.$text = { $search: body.search };
}
my code like
const filter: any = { isDeleted: false, venueOwnerId: null };
if (body.search !== undefined && body.search !== null) {
filter.$text = { $search: body.search };
}
const restaurant = await this.restaurantModel.find(filter, {
_id: 1,
name: 1,
});
but we fire all record my total record around 6lakhs up then it load API not any response from db How can I get a large amount of data in less time in MongoDB? Is the above program correct? If so, please update it.