What to do with message "Too much records, Only 10000 records to show from the end of the logs."?

Лили Эванс shared this question 10 months ago
Answered

I executed script that gave 20 000 results. Unfortunately I can see only last 10 000, because here is the message "Too much records, Only 10000 records to show from the end of the logs."

What should I do? Is it possible to increase the number of records in log or to export full log into a file?

Comments (2)

photo
1

Displaying too many lines can result in poor UI performance for the editor. You can add the following code to the file header to write the output to the file

console.log = function(...d) { //
    require("fs").appendFileSync("mylog.txt",    require("util").format(...d) + '\n')
};

photo
1

What the file header do you mean?

photo
2

Just rewrite console.log. In fact, can be anywhere in your javascript file.

photo
1

Could you tell me step by step please? I don't work with mongo DB. I need to get data from a big collection via nosqlbooster. I add your code to the query part in UI of the program, but nothing change and I can't find mylog.txt.4efc4264eabfeb1698b18894c9f1fc27

photo
1

//Please change print to console.log
console.log = function(...d) { //
    require("fs").appendFileSync("c:/temp/mylog.txt",    require("util").format(...d) + '\n')
};

db.testCollection.find({})
   .limit(21).forEach((it)=> { 
         console.log(it._id)
   });

photo