.pretty
vil først virkelig ændre tingene, når du har indlejrede eller større dokumenter:
> db.so.insert( { name: "Derick" } );
> db.so.insert( { f: 'Derick', s: 'Rethans', t: 'derickr' } );
> db.so.insert( { name: { f: 'Derick', s: 'Rethans' } } );
> db.so.find();
{ "_id" : ObjectId("520e49a21d7b77441eaf6446"), "name" : "Derick" }
{ "_id" : ObjectId("520e49b11d7b77441eaf6447"), "name" : { "f" : "Derick", "s" : "Rethans" } }
> db.so.find().pretty();
{ "_id" : ObjectId("520e49a21d7b77441eaf6446"), "name" : "Derick" }
{
"_id" : ObjectId("520e4f895a4563e39f06b030"),
"f" : "Derick",
"s" : "Rethans",
"t" : "derickr"
}
{
"_id" : ObjectId("520e49b11d7b77441eaf6447"),
"name" : {
"f" : "Derick",
"s" : "Rethans"
}
}
Så jeg formoder, at det fungerer fint for dig!