email foo bar
1 [email protected] 23 34
2 [email protected] 43 34
3 [email protected] 35 32
Now I want to create JSON docs for each email as of following form:
doc 1: { "email" : "[email protected]"}
doc 2: { "email" : "[email protected]"}
doc 3: { "email" : "[email protected]"}
My final goal is to insert these docs in MongoDB using dbInsertDocument() from RMongo.
I have been toying with toJSON() but couldn't figure out a way. How do I convert final$email in JSON docs as described above?
I'm not sure if this is what you need:
final$emailhas not column name so it is not included in the output oftoJSON(final$email)