db.getReplicationInfo() timeDiff and timeDiffHours is incorrect

Stephen Fensom shared this problem 3 years ago
Solved

From noSqlBooster shell, the results from db.getReplicationInfo() differs to what I see when using mongo shell and other tools that display the replication information (cloud.mongodb.com). I'm confident I am connected to the same individual instances in the replica set for these comparisons, and have tried many different combinations just in case, but still see the same discrepancy. The tFirst and tLast are also incorrect.

I'm using NoSQLBooster for MongoDB free edition, on Mac, v 5.2.10.

e.g. NoSqlBooster:

{

"logSizeMB" : 25877.776123046875,

"usedMB" : 25751.28,

"timeDiff" : -580,

"timeDiffHours" : -0.16,

"tFirst" : "Thu Jan 01 1970 01:15:24 GMT+0100 (Greenwich Mean Time)",

"tLast" : "Thu Jan 01 1970 01:05:44 GMT+0100 (Greenwich Mean Time)",

"now" : "Fri Apr 10 2020 12:52:52 GMT+0100 (Irish Standard Time)"

}

Mongo shell:

{

"logSizeMB" : 25877.776123046875,

"usedMB" : 25752.4,

"timeDiff" : 58249,

"timeDiffHours" : 16.18,

"tFirst" : "Thu Apr 09 2020 20:42:03 GMT+0100 (IST)",

"tLast" : "Fri Apr 10 2020 12:52:52 GMT+0100 (IST)",

"now" : "Fri Apr 10 2020 12:52:52 GMT+0100 (IST)"


}

Replies (3)

photo
1

The "Timestamp" implementation of node.js driver is a little incompatible with the mongo shell. We have worked out a new test build to resolve this issue, please download and give it a try.

MacOS: https://nosqlbooster.com/s3/download/releasesv5/nosqlbooster4mongo-5.2.11-beta.1.dmg

photo
1

Resolved in 5.2.11

photo
1

Can you pls share me the code snippet for connection of Node JS with MongoDB to execute printReplicationInfo

Leave a Comment
 
Attach a file