Skip to content

Commit

Permalink
More URL updating
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Mar 14, 2017
1 parent 88d2b13 commit 9ba0c92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions R/mongo.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' MongoDB client
#'
#' Connect to a MongoDB collection. Returns a [mongo] connection object with
#' methods listed below. The [mongolite user manual](https://jeroenooms.github.io/mongolite/)
#' methods listed below. The [mongolite user manual](https://jeroen.github.io/mongolite/)
#' is the best place to get started.
#'
#' @export
#' @aliases mongolite
#' @references [Mongolite User Manual](https://jeroenooms.github.io/mongolite/)
#' @references [Mongolite User Manual](https://jeroen.github.io/mongolite/)
#' @param url address of the mongodb server in mongo connection string
#' [URI format](http://docs.mongodb.org/manual/reference/connection-string)
#' @param db name of database
Expand Down Expand Up @@ -76,7 +76,7 @@
#'
#' # Import from jsonlines stream from connection
#' dmd <- mongo("diamonds")
#' dmd$import(url("http://jeroenooms.github.io/data/diamonds.json"))
#' dmd$import(url("http://jeroen.github.io/data/diamonds.json"))
#' dmd$count()
#'
#' # Export
Expand Down
6 changes: 3 additions & 3 deletions man/mongo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions test/yelp.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ library(curl)

# Collection with yelp 'users'
user <- mongo("user", db = "yelp")
user$import(gzcon(curl("https://jeroenooms.github.io/data/yelp_training_set_user.json.gz")))
user$import(gzcon(curl("https://jeroen.github.io/data/yelp_training_set_user.json.gz")))
user$count()
str(sample <- user$find(limit=10))
View(sample)

# Collection with yelp 'businesses'
business <- mongo("business", db = "yelp")
business$import(gzcon(curl("https://jeroenooms.github.io/data/yelp_training_set_business.json.gz")))
business$import(gzcon(curl("https://jeroen.github.io/data/yelp_training_set_business.json.gz")))
business$count()
str(sample <- business$find(limit=10))
View(sample)

# Collection with 'checkins'
# NB: weird (non-tidy) format: See https://www.kaggle.com/c/yelp-recsys-2013/data
checkin <- mongo("checkin", db = "yelp")
checkin$import(gzcon(curl("https://jeroenooms.github.io/data/yelp_training_set_checkin.json.gz")))
checkin$import(gzcon(curl("https://jeroen.github.io/data/yelp_training_set_checkin.json.gz")))
checkin$count()
str(sample <- checkin$find(limit=10))

# Collection with 'reviews' (80MB download)
review <- mongo("review", db = "yelp")
review$import(gzcon(curl("https://jeroenooms.github.io/data/yelp_training_set_review.json.gz")))
review$import(gzcon(curl("https://jeroen.github.io/data/yelp_training_set_review.json.gz")))
review$count()
str(sample <- review$find(limit=10))
View(sample)
Expand Down

0 comments on commit 9ba0c92

Please sign in to comment.