Hi , I have posts collection and fetch the datas depending on three properties.
I have two types of posts which are seperated with the boolean isCoin:true and isCoin:false.
I also always use updatedAt:-1 when querying.
So, I have two scenarios ;
- querying isCoin:true/false updatedAt:-1
- coinid:givenCoinId , updatedAt:-1
in the first scenario i dont use coinid when fetching , I just fetch them depending on isCoin property and updatedAt descending
in the second scenario I use coinid and updatedAt descending,
so what kind of Indexing should I use to optimise those request ?
in total I have three varieables to be taken into account → isCoin , updatedAt:-1 and coinid(objectid)
I have three properties isCoin updatedAt:-1 and coinid(objectid)
I have two query scenarios
1-) isCoin:true or false and updatedAt:-1
2-) coinid(objectid) and updatedAt:-1