Indexes များသည် MongoDB ၏ query performance ကို မြှင့်တင်ရန် အထူး data structures များဖြစ်သည်။ Index မရှိပါက MongoDB သည် collection တစ်ခုလုံးကို scan လုပ်ရသည် (collection scan)။ Index ရှိပါက query သည် index ကို အသုံးပြုပြီး data များကို ပိုမိုလျင်မြန်စွာ ရှာဖွေနိုင်သည်။
javascript
// Create a single field index on the 'item' field
db.inventory.createIndex( { item: 1 } )
// 1 for ascending order, -1 for descending orderYou should see
(item field တွင် index တစ်ခု တည်ဆောက်ပြီးသွားမည်။ ဤ field ဖြင့် ရှာဖွေပါက ပိုမိုမြန်ဆန်လာမည်)