Is there a way to query mongodb in such a way that I can retrieve the time?
I often do a check where I check the time the mongodb server is running on before putting data on. I need to know the time on the db server from the point of view of a client.
I’m using the C# .NET wrapper, but if there is a query that can do this on any platform that would be nice too. How would would I get the db time?
I know there are obviously other ways to do this, by synchronizing times. But I need to use this option so there can be no tampering with the local time
db.hostInfo()returns an object wheresystem.currentTimeis the current time on the server’s host.