MongoDB - PHP - MongoCursorException 'Cursor not found'
I have 2 collections: A (3.8M docs) and B (1.7M docs) I have a PHP script that I run from the shell that: loops over each record in A ~60% of the time, it does a findOne on B (using _id) does some basic math, creating a php array once the loop on all docs in a is done: 4) loop over php array 5)upsert into collection C during (1), I consistently get: PHP Fatal error: Uncaught exception 'MongoCursorException' with message 'Cursor not found' The last item processed was #8187 of 3872494. real 1m25.478s user 0m0.076s sys 0m0.064s Running it again, with no change in code, the exception got thrown at