restrict document array size to prevent db from running too slow