What would be the type of the variable returned if the type of variable in mongodb is datetime?
When I convert it into json, what will be displayed? Will it be a large number like unix time stamp or what?
What would be the type of the variable returned if the type of variable in mongodb is datetime?
When I convert it into json, what will be displayed? Will it be a large number like unix time stamp or what?
Best to use mongos native JavaScript Date objects.
You can convert date objects to and from Unix timestamps using 'getTime()' method or 'Date(milliseconds)'
Remember the JavaScript Date object is measured in milliseconds due to the the Unix epoch.