Ankit Chandra
unread,Oct 30, 2012, 1:33:44 AM10/30/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi!
I am trying to load an entire log file into a document in mongodb. I
first break the log file into lines, do some processing on the
individual lines and then concatenate them together to insert them
into mongodb. Now the issue is that no matter what I try,
db.collection.find(), or db.collection.find().pretty() commands don't
display the inserted documents broken up into separate lines, on the
basis of the "\n"s I added in between the lines.
What am I missing? How can I add new line characters to the document
such that i can have them on a new line as needed? it currently shows
up as:
> db.r_20120322110650_20040911.find().pretty();
{
"_id" : ObjectId("507f94161a86693a1a000000"),
"generic" : "\n -- beginning my random stuff \n -- ExecProg: Running
fullcommand = /usr/bin/time --verbose -o what-on-earth.txt \n this is
crazy/ ........
...
...
...
}
Notice the "\n"s strewn all about the document...
Any way I can have it show up as:
> db.r_20120322110650_20040911.find().pretty();
{
"_id" : ObjectId("507f94161a86693a1a000000"),
"generic" : "
-- beginning my random stuff
-- ExecProg: Running fullcommand = /usr/bin/time --verbose -o what-on-
earth.txt
this is crazy/ ........
...
...
...
}
Thanks!