-2

PAYMENT_ID is a non-null column. I will get an average of 10 documents per quey by PAYMENT_ID.

When i create index for that column in mongo db, mongodb compass asks me to choose index type. Here are the selections. Which option would be the best for this kind of acolumn?

enter image description here

yılmaz
  • 365
  • 1
  • 14

1 Answers1

0

Asc - Ascending order

Desc - Descending order

This is use in query order - https://www.mongodb.com/docs/manual/tutorial/sort-results-with-indexes/

2dsphere - Used for geospatial queries.

Text - Used for text search queries.

For normal indexes you should select asc or desc.

Someone Special
  • 12,479
  • 7
  • 45
  • 76