Skip to content

Commit 6afc1d1

Browse files
committed
collect_sdd() with user/password arguments
1 parent 5d6cb6b commit 6afc1d1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
- Review of the all tutorials (00a - 13c) with the **svbox 2019**
66

7+
- Internal function `collect_sdd()` now has `user =` and `password =` arguments
8+
and the user/password used by default by `record_sdd()` cannot read data in
9+
the database anymore.
10+
11+
712
## Changes in version 2018.0.0
813

914
- `run()` modified to install latest release matching svbox year.

R/record_sdd.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ record_sdd <- function(tutorial_id, tutorial_version, user_id, event, data) {
7979
# Use: options(tutorial.event_recorder = record_sdd)
8080
#
8181
# To collect these data:
82-
collect_sdd <- function() {
83-
mdb <- mongolite::mongo("sdd", #url = "mongodb://sdd:sdd@ds125318.mlab.com:25318/sdd-cours")
84-
#url = "mongodb://sdd:sdd@ds125388.mlab.com:25388/sdd-test")
85-
url = "mongodb://sdd:sdd@sdd-umons-shard-00-00-umnnw.mongodb.net:27017,sdd-umons-shard-00-01-umnnw.mongodb.net:27017,sdd-umons-shard-00-02-umnnw.mongodb.net:27017/test?ssl=true&replicaSet=sdd-umons-shard-0&authSource=admin")
86-
# url = "mongodb://sdd:sdd@sdd-umons-shard-00-01-umnnw.mongodb.net:27017")
87-
#mongodb://sdd:<PASSWORD>@sdd-umons-shard-00-00-umnnw.mongodb.net:27017,sdd-umons-shard-00-01-umnnw.mongodb.net:27017,sdd-umons-shard-00-02-umnnw.mongodb.net:27017/test?ssl=true&replicaSet=sdd-umons-shard-0&authSource=admin
82+
collect_sdd <- function(user, password) {
83+
mdb <- mongolite::mongo("sdd",
84+
url = paste0("mongodb://", user, ":", password, "@sdd-umons-shard-00-00-umnnw.mongodb.net:27017,sdd-umons-shard-00-01-umnnw.mongodb.net:27017,sdd-umons-shard-00-02-umnnw.mongodb.net:27017/test?ssl=true&replicaSet=sdd-umons-shard-0&authSource=admin"))
8885
#print(mdb)
8986
if (mdb$count())
9087
mdb$find()

0 commit comments

Comments
 (0)