How to create and use Indexes in iOS Swift?

Hi Team,

Document model is
{
type:“Plu”,
upc:“123456”,
des:“new plu added”,
price:“1.0”
progresStatus:{
operationType:“adding”,
operationTime:“21:30:56”
}
}
In my database nearly one million documents available. When I am getting these documents using QueryBuilder it will take time to return documents. To over come this I want to use Indexes concept. Some times I need to create index using “desc” and some times “operationType” key. In the below link I found the creating Index code but couldn’t found how to use created Index? Please help me out.

Thanks in advance

Using them is automatic, there is no explicit API call needed to use them. If you want to find out if they are being used, then call explain on your query and see if it contains the index name in the output.