Created
February 17, 2015 22:48
-
-
Save aphyr/20f3c41ef44f97ca2090 to your computer and use it in GitHub Desktop.
MongoDB "printjson" printing I don't know what
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@n1:~# mongo --quiet --eval 'printjson(rs.status())' | |
{ | |
"set" : "jepsen", | |
"date" : ISODate("2015-02-17T22:48:35Z"), | |
"myState" : 1, | |
"members" : [ | |
{ | |
"_id" : 0, | |
"name" : "n1:27017", | |
"health" : 1, | |
"state" : 1, | |
"stateStr" : "PRIMARY", | |
"uptime" : 293, | |
"optime" : Timestamp(1424205484, 1), | |
"optimeDate" : ISODate("2015-02-17T20:38:04Z"), | |
"electionTime" : Timestamp(1424213022, 11), | |
"electionDate" : ISODate("2015-02-17T22:43:42Z"), | |
"self" : true | |
} | |
], | |
"ok" : 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
But this makes perfect sense. You see, Mongo has this thing called "BSON" which is totally 100% compatible with JSON, therefor there's no point in adding a function such as
printbson
because we can already useprintjson
.