Skip to content Skip to sidebar Skip to footer

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 javascriptwithsc

Solution 1:

Basically we need to do nothing :-) with data type as mongo engine will apply correct type to inserted data.

When creating a javascript object which will be inserted to mongo:

varobject = {
    thisWillBeNumber : 1,
    thisWillBeString :"aaa",
    thisWillBeAnArray = [1,2,3]
    thisWillBeDateTime: newDate()  
}

then mongo uses javascript object type and savs it. In some drivers/framework we can enforce on application level types of our field/variables and such information could be added to stored document.

Post a Comment for "What Is The Use Of Type Javascript/javascriptwithscope Of Bson"