In MySQL for example you have data types such as varchar, int, etc. I googled and found http://docs.mongodb.org/manual/core/document/#bson-types page. It seems like with string you just use '' or "". Integers seem to be automatically recognized without specifing the type. How would inserting something like this into mongoDB collection in Perl look like?
Example:
{
"Name" : "John"
"Age" : 20
"Weight" : 180.5
"Dateofbirth" : 01/01/1990
}
The reason why I want data type specified in the db is that I can use operators to compare numbers for example. If it is text I cannot do that. So far I am thinking in Perl:
$my_collection->insert({
'Name' : "$Name",
'Age' : $age,
'Weight':$weight,
'Dateofbirth': $datevar,
} );
In the above code I am not sure how to specify the data type. For example to tell Weight is Double not integer or string.