Hi,
I use Mongocxx to query the single mongod running on linux.
I have an aggregation query which might return > 1 documents on the cursor but I am getting the exception - “Failed to send “getMore” command with database “”: Failed to read 16716027 bytes: socket error or timeout: generic server error”, I believe this is due to cursor getting timedout before even I process the current document.
Actually while iterating over the cursor, for each document I have a gridfs file ID saved so I get the file_id from the document and then get the data from gridfs using gridfs bucket apis ( open_download_stream and read ), can this take time enough to result in cursor timeout ? If yes then is there a way to keep the server alive with any query flag while I process the gridfs api?
MaxTimeMs is the one which is for getting the data from dbserver, in this case I guess the data got retrieved within the timeout ?
noCursorTimeout is the option only available with find query, not with aggregate.
Could someone tell which query option I can use to avoid this kind of errors ?