Open StefanoSpada opened 10 years ago
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
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) :)
A collection in mongo containing special char as a value, such as \r\n ..., results in breaking the returned data frame.
e.g.
{ "_id" : ObjectId("a_value"), "item" : "nospecial", "qty" : "15" }
{ "_id" : ObjectId("a_value"), "item" : "spec\r\r\nial", "qty" : "15" }
1 a_value nospecial 15
2 a_valuer spec NA
3 ial 15 NA