Baidu for a long time, I know mongo default read-only 101 records every time out,
Because at present a total of more than 30000 records in the database, so I put the BatchSize set to 40000, at present my solution is this:
Max_record:=int32 (40000)
Cursor, err:=video_collection. Find (context. The Background (), the filter, the options. The Find () SetBatchSize (max_record))
But later if the number of records of more than 40000 or more, I can only compile again,
But I also fear that would take up too much memory (is currently takes up about 1 g, barely hold up),
Because I am a novice, please help to look at, how to write can make golang read all of the records?