title: How to get the defined indexes from Mongoose
body: <p>I have been trying to find out the indexes which are already created via MongoDB manually( I have created 2d sphere indexes for two fields via mongobooster and creating one via schema by defining it). Now if i run this query in mongodbooster </p>
  
  <pre><code>db.collectionname.getIndexes(); 
  </code></pre>
  
  <p>It results me the 3 documents with name.key and which indexes i have used. I want to perform this same operation in mongoose i can't find a equivalent query for the same. I tried this </p>
  
  <pre><code>const indexes = OrderSchema.indexes();
  console.log('index:', indexes);
  </code></pre>
  
  <p>But it gives me only one index which i have defined in schema that is _id i need two other fields as well which contains 2d-sphere index how can i get that too. What am trying to achieve here is if 2d sphere indexes are already created don't create an index else create an index that's all am trying to achieve here. Any help is appreciated Thanks </p>