Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Last active June 15, 2018 06:02
Show Gist options
  • Save sarjarapu/6d2f053b160592ab1d091c1425dcaa0f to your computer and use it in GitHub Desktop.
Save sarjarapu/6d2f053b160592ab1d091c1425dcaa0f to your computer and use it in GitHub Desktop.
A JavaScript function calls showing the database printSlaveReplicationInfo command output
db.printSlaveReplicationInfo()
/*
source: mon02:27000
syncedTo: Fri Jun 15 2018 01:29:11 GMT+0000 (UTC)
0 secs (0 hrs) behind the primary
source: mon03:27000
syncedTo: Fri Jun 15 2018 01:29:11 GMT+0000 (UTC)
0 secs (0 hrs) behind the primary
*/
rs.status().members.map(x=>x.pingMs)
// [ undefined, NumberLong(0), NumberLong(78) ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment