I'm new to nodejs and trying to inject mongodb to insert the current timestamp in milliseconds using nodejs, which it introduces as a double value. Can someone help me how to insert this NumberLong value.
var data = { myId : uniqueId, Timestamp : Date.now(), ---> This one is getting inserted as double. userData : applicationData } }
I am also trying to insert like this, but its getting the insert as a string.
var mongo=require('mongodb'); var Long = mongo.Long; var data = { myId : uniqueId, Timestamp : Long.fromString((Date.now() + "")), ---> This one is getting inserted as String. userData : applicationData } }
Kamalanathan
source share