Skip to content

Commit 40fb360

Browse files
committed
m$disconnect() also not available in mongolite version 1.5 => commented out
1 parent 18e77f2 commit 40fb360

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Authors@R: c(
1010
email = "[email protected]"))
1111
Maintainer: Philippe Grosjean <[email protected]>
1212
Depends: R (>= 3.3.0)
13-
Imports: learnr, httr, jsonlite, remotes, svMisc, mongolite
13+
Imports: learnr, httr, jsonlite, remotes, svMisc, mongolite (>= 1.5)
1414
Suggests: SciViews, ggplot2, ggpubr, data.io, flow, chart, covr, knitr, testthat
1515
License: CC BY-SA 4.0
1616
Encoding: UTF-8

R/record_sdd.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ record_sdd <- function(tutorial_id, tutorial_version, user_id, event, data) {
5454
url = "mongodb://sdd:[email protected]: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"),
5555
silent = TRUE)
5656
if (!inherits(m, "try-error") &&
57+
# No run() methods in mongolite 1.5
5758
#m$run(command = "{\"ping\": 1}", simplify = TRUE)$ok == 1) {
5859
m$count() > -1) {
5960
m$insert(entry)
@@ -65,7 +66,8 @@ record_sdd <- function(tutorial_id, tutorial_version, user_id, event, data) {
6566
for (i in 1:length(dat))
6667
m$insert(unserialize(base64_dec(dat[i])))
6768
}
68-
m$disconnect()
69+
# No disconnect() method in mongolite 1.5
70+
#m$disconnect()
6971
} else {# MongoDB database not available... save locally
7072
add_file_base64(entry, file = bds_file)
7173
}

0 commit comments

Comments
 (0)