Skip to content

R & MongoDB

3 messages · Nordlund, Dan (DSHS/RDA), Fernando Mozas Enguita

#
Hi Everyone!

I?m new in R-world and I need help.
I need to make an R-script for PowerBI to connect with a MongoDB data source and I don?t have so much idea

I have a dataset in a Mongo DB like this:

/* 1 */
{
    "_id" : ObjectId("5819ad77d8828e871ce09297"),
    "Date" : 1478077741,
    "Receptor" : "CORMAD",
    "Position" : "02112016",
    "clients" : [
        {
            "mac" : "A2:C2:CA:18:F0:5E",
            "vendor" : "",
            "lastSeen" : 1478077746,
            "power" : -80,
            "R" : "",
            "bssid" : "(not associated) ",
            "essid" : [],
            "probedESSID" : [
                "any"
            ]
        },
        {
            "mac" : "D6:B0:C2:0E:2B:A0",
            "vendor" : "",
            "lastSeen" : 1478077755,
            "power" : -78,
            "R" : "",
            "bssid" : "(not associated) ",
            "essid" : [],
            "probedESSID" : [
                "any"
            ]
        }
/* 2 */
{
    "_id" : ObjectId("5819b009d8828e871ce092dc"),
    "Date" : 1478078401,
    "Receptor" : "CORMAD",
    "Position" : "02112016",
    "clients" : [
        {
            "mac" : "C0:38:96:86:1E:91",
            "vendor" : "HonHaiPr",
            "lastSeen" : 1478078443,
            "power" : -80,
            "R" : "",
            "bssid" : "0A:18:D6:2B:7F:EB",
            "essid" : [],
            "probedESSID" : [
                "any"
            ]
        },
        {
            "mac" : "F4:F1:E1:60:73:D2",
            "vendor" : "Motorola",
            "lastSeen" : 1478078410,
            "power" : -78,
            "R" : "",
            "bssid" : "(not associated) ",
            "essid" : [],
            "probedESSID" : [
                "JAZZTEL_HY7S"
            ]
        }

How can I iterate throw all the clients to extract the information?
I need to have a classic table with the information.
One row with the fields :
_id | Date | Receptor | Position | clients | mac | vendor | lastSeen | power | R | bssid | essid | probedESSID


Thanks!
Fernando.
#
Here are some links that may get you started.

https://www.r-bloggers.com/r-and-mongodb/
https://cran.r-project.org/web/packages/mongolite/vignettes/intro.html
https://www.opencpu.org/posts/mongolite-release-0-3/


You may also want to ask your question on the R-sig-DB Mailing list.

https://stat.ethz.ch/mailman/listinfo/r-sig-db


Good luck!

Dan

Daniel Nordlund, PhD
Research and Data Analysis Division
Services & Enterprise Support Administration
Washington State Department of Social and Health Services
#
Thanks Daniel for the info,

My principal problem is that I have the script on R and Works fine.
But When I copy on Power BI, it Didn?t work.

I would like to know if someone have worked with the combination of Mongo + R + PowerBI and had the same probllem.

Thanks!
 


-----Mensaje original-----
De: Nordlund, Dan (DSHS/RDA) [mailto:NordlDJ at dshs.wa.gov] 
Enviado el: viernes, 2 de diciembre de 2016 1:44
Para: Fernando Mozas Enguita <fernando.mozas at trackglobe.com>; r-help at R-project.org
Asunto: RE: R & MongoDB

Here are some links that may get you started.

https://www.r-bloggers.com/r-and-mongodb/
https://cran.r-project.org/web/packages/mongolite/vignettes/intro.html
https://www.opencpu.org/posts/mongolite-release-0-3/


You may also want to ask your question on the R-sig-DB Mailing list.

https://stat.ethz.ch/mailman/listinfo/r-sig-db


Good luck!

Dan

Daniel Nordlund, PhD
Research and Data Analysis Division
Services & Enterprise Support Administration Washington State Department of Social and Health Services