Is there a method to get Mongodb time in a nodejs program?

Viewed 18

I want to get Mongodb machine time in my nodejs program(not my local time), how can I write the sql?

1 Answers

There is no "SQL" in mongodb, anyway you have to use

db.hostInfo()

More about it, here. So now you can access to

hostInfo.system.currentTime

to get the timestamp of the current system time.

Related