I have the following classes:
class Product { protected $regDate; protected $expire; protected $price; protected $isFeatured; protected $visits; } class Price { protected $value; protected $currency; } class Visit { protected $total; protected $today; protected $perDate = array(); } class VisitPerDate { protected $date; protected $visit; }
I want to apply some composite indexes in a product document. The indexes I want to add to the database are as follows:
{ "status"=1, "regDate"=-1, "expDate"=1, "isFeatured"=1 } { "status"=1, "visits.total"=1, "visits.today"=1, "regDate"=1 } { "status"=1, "price.value"=1, "regDate"=1 }
Was the correct annotation for indexing? It seems that the first index should be correct, but I believe that the second and third indexes are incorrect!
source share