Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11525

Provide nicer message when converting JS to BSON if too big

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.4
    • Component/s: JavaScript, Shell
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: