Provide nicer message when converting JS to BSON if too big

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.5.4
    • Affects Version/s: None
    • Component/s: JavaScript, Shell
    • None
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When you run something like this:

      var f = function() { 
      	var makeBigString = function(bigSize) {
      	    var bigStr = 'x';
      	    while (bigStr.length < bigSize) {
      	        bigStr += bigStr;
      	    }
      	    return bigStr
      	} 
       	var bigstr =  makeBigString(1024*1024*20);
       	return {a:bigstr}; 
      };
      
      db.eval(f);
      
      Object.bsonsize(f());
      

      The places to check see to be in V8ToMongo (scripting/engine_v8.h/cpp), and other function which convert to BSON.

            Assignee:
            Mathias Stearn
            Reporter:
            Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: