skip to Main Content

MongoDB 10m search documents

How can I optimize mongoDB search if I have 10+ million documents in one collection? If anything, please, don't advise me to switch to mysql. I need mongodb specifically For example one of the logs { "_id": { "$oid": "Some…

VIEW QUESTION

Using lookup with group in mongodb

I have a bunch of records in this format on mongodb [ {_id: 1, date:'2023-07-28',sales:1,ad_id:1,status: 'Active'}, {_id: 2 , date:'2023-07-29',sales:2,ad_id:1,status: 'Active'}, {_id: 3, date: '2023-07-30',sales: 4,ad_id:1,status: 'Paused'} ] Now if I want data from date 2023-07-28 to 2023-07-29 . I…

VIEW QUESTION

Constructing a MongoDB query to emulate JavaScript filtering logic (filter+every) using Mongoose for multiple search terms

Introduction I am building a search feature using mongodb with mongoose ODM. The codebase is already having an search feature using javascript. The code terms.every((term) => { const cleanedTerm = term.trim(); return ( usernameLower.includes(cleanedTerm) || nameLower.includes(cleanedTerm) || userTagsString.includes(cleanedTerm) || userLocationString.includes(cleanedTerm)…

VIEW QUESTION
Back To Top
Search