Description Usage Arguments Details Value Note Author(s)
Read or pull or modify data in a cluster database
1 2 3 4 5 6 7 8 9 10 11 12 13 | mongo_manipulation(
collection = config$collection,
database = config$database,
host = config$host,
username = config$username,
password = config$password,
mongo_choice = c("push", "pull", "update_record", "delete_record"),
push_record = NULL,
id_filter = NULL,
element_id_filter = NULL,
id_update = NULL,
element_id_update = NULL
)
|
collection |
your cluster |
database |
name of database inside the |
host |
host of the |
username |
Your username to enter to the |
password |
your password to enter to the |
mongo_choice |
choice that we want to do with a database in a collection |
push_record |
dataset we want to push to the collection |
id_filter |
variable of the dataset that we want to filter when we pull this. |
element_id_filter |
observation of |
id_update |
variable of the dataset that we want to update. |
element_id_update |
values to update for the variable |
This function allows you to push, pull or modify a database
"This function returns different results based on mongo_choice
variable:"
If mongo_choice = "push"
then you only need to use the variable push_record
to push the table with the information to your MongoDB collection.
If mongo_choice = "pull"
is not necessary to use other variable, because you are going to pull the dataset from the config file.
If mongo_choice = "pull"
and use the variables id_filter
and element_id_filter
to pull a table from the dataset.
If mongo_choice = "update_record"
and use the variables id_filter
, element_id_filter
, id_update
, element_id_update
to update a record from a table from the dataset.
If mongo_choice = "delete_record"
and use the variables id_filter
and element_id_filter
to delete a table from the dataset.
You can use this function inside your shiny app.
If mongo_choice = "pull"
then the variable pull_info
is going to be saved in your global environment with the pull information. So is not necessary to assign this function.
Eduardo Trujillo
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.