Question: You have a collection with millions of documents. Each time you attempt to sort. MongoDB runs out of memory. What might help?

  1. Use the purge operator before the sort.
  2. Return the entire collection and sort on the client.
  3. Pass the --more-memory option.
  4. Create an index on the field you are sorting.

Answer: The correct answer of the above question is Option D:Create an index on the field you are sorting.