Create ensureIndex to avoid Error: too much data for sort() with no index