RMongo icon indicating copy to clipboard operation
RMongo copied to clipboard

rmongo doesn't handle correctly \r and \n characters

Open StefanoSpada opened this issue 10 years ago • 1 comments

A collection in mongo containing special char as a value, such as \r\n ..., results in breaking the returned data frame.

e.g.

db.test.find() --- in mongo

{ "_id" : ObjectId("a_value"), "item" : "nospecial", "qty" : "15" }

{ "_id" : ObjectId("a_value"), "item" : "spec\r\r\nial", "qty" : "15" }

dataframe -- in R

                  X_id      item qty

1 a_value nospecial 15

2 a_valuer spec NA

3 ial 15 NA

StefanoSpada avatar Jun 02 '14 19:06 StefanoSpada

Thanks @StefanoSpada i added a failing unit test to https://github.com/tc/RMongo/tree/bug-fix/newline

Happy to accept any patch requests to pass the tests (R CMD check) :)

tc avatar Jun 06 '14 15:06 tc