MongoDB collection with no indexes
Part of the Schema & indexes check · fix arrives as a guide
What it is
A MongoDB collection has no indexes beyond the default _id.
Why it matters
Every query filtering on anything else performs a collection scan. MongoDB will happily do this, and the query planner gives no warning until the collection is large enough for the scan to dominate response time.
How to fix it
Index the fields your queries filter and sort on, matching the order of a compound index to the query shape. Modern MongoDB takes only a brief exclusive lock, so build in a low-traffic window — and on a replica set consider a rolling build. The background option was deprecated in 4.2 and removed after.
Run them all on your app
Connect your repo and your live services with read-only scopes. The first scan is free, and nothing changes without your approval.