If you want to output Objects in MongoDB shell, you can’t output with print(), so use printjson().
Below are sample execution results of Object with print() and printjson().
> var object = { a : 1 , b : 2 };
> print(object);
[object Object]
> printjson(object);
{ "a" : 1, "b" : 2 }
> printjson(1)
1
> printjson("a")
"a"
In most cases, it’s probably good to use printjson().
That’s all from the Gemba.