What is the use of type javascript/javascriptwithscope of bson
问题 I am wondering about the use of these two type of bson (javascript/javascriptwithscope); as the base type of bson. What's the use case of it and how to generate a javascriptwithscope object to save in mongodb? Type Number Alias Notes Double 1 “double” String 2 “string” Object 3 “object” Array 4 “array” Binary data 5 “binData” Undefined 6 “undefined” Deprecated. ObjectId 7 “objectId” Boolean 8 “bool” Date 9 “date” Null 10 “null” Regular Expression 11 “regex” DBPointer 12 “dbPointer” JavaScript