| DataStorageMongoDB | R Documentation |
Implementation of the DataStorage R6 class to MongoDB backend using a
unified API for read/write operations
shiny.telemetry::DataStorage -> DataStorageMongoDB
new()Initialize the data storage class
DataStorageMongoDB$new( hostname = "localhost", port = 27017, username = NULL, password = NULL, authdb = NULL, dbname = "shiny_telemetry", options = NULL, ssl_options = mongolite::ssl_options() )
hostnamethe hostname or IP address of the MongoDB server.
portthe port number of the MongoDB server (default is 27017).
usernamethe username for authentication (optional).
passwordthe password for authentication (optional).
authdbthe default authentication database (optional).
dbnamename of database (default is "shiny_telemetry").
optionsAdditional connection options in a named list format (e.g., list(ssl = "true", replicaSet = "myreplicaset")) (optional).
ssl_optionsadditional connection options such as SSL keys/certs
(default is mongolite::ssl_options()).
clone()The objects of this class are cloneable with this method.
DataStorageMongoDB$clone(deep = FALSE)
deepWhether to make a deep clone.
## Not run:
data_storage <- DataStorageMongoDB$new(
host = "localhost",
db = "test",
ssl_options = mongolite::ssl_options()
)
data_storage$insert("example", "test_event", "session1")
data_storage$insert("example", "input", "s1", list(id = "id1"))
data_storage$insert("example", "input", "s1", list(id = "id2", value = 32))
data_storage$insert(
"example", "test_event_3_days_ago", "session1",
time = lubridate::as_datetime(lubridate::today() - 3)
)
data_storage$read_event_data()
data_storage$read_event_data(Sys.Date() - 1, Sys.Date() + 1)
data_storage$close()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.