Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 2, 2024
1 parent 4bc36d6 commit 7b669e4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: High-performance MongoDB client based on 'mongo-c-driver' and 'json
Includes support for aggregation, indexing, map-reduce, streaming, encryption,
enterprise authentication, and GridFS. The online user manual provides an overview
of the available methods in the package: <https://jeroen.github.io/mongolite/>.
Version: 2.8.1
Version: 2.8.2
Authors@R: c(
person("Jeroen", "Ooms", ,"jeroenooms@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4035-0289")),
Expand All @@ -19,7 +19,7 @@ License: Apache License 2.0
URL: https://jeroen.r-universe.dev/mongolite
BugReports: https://github.com/jeroen/mongolite/issues
SystemRequirements: OpenSSL, Cyrus SASL (aka libsasl2)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2.9000
Roxygen: list(markdown = TRUE)
Suggests:
spelling,
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.8.2
- Add function bson_read() to read mongodb dumps

2.8.0
- Update vendored mongo-c-driver to 1.26.2

Expand Down
13 changes: 8 additions & 5 deletions R/reader.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#' Standalone BSON reader
#'
#' Utility to parse BSON files into R without using MongoDB. This is useful
#' to read data from a `mongoexport` dump without needing local mongodb server.
#' This reads all data in memory. To import a bson dump into your local mongodb
#' server, use the [mongo$import][mongo] function instead.
#' Utility to parse BSON data into R without using MongoDB. Useful to read data
#' from a `mongoexport` dump without mongodb if it fits in memory.
#'
#' To import a bson dump into a local mongodb server, use the [mongo$import][mongo]
#' function instead. This requires less memory and once data is in mongo you can
#' easily query it.
#'
#' @export
#' @useDynLib mongolite R_bson_reader_new R_bson_reader_read
#' @param con either a path to a file, a url, or a a connection object
#' @param as_json return data as json strings instead of R lists
#' @param verbose print some output as we read
#' @return list with either data objects or json strings
#' @examples
#' diamonds <- read_bson("http://jeroen.github.io/data/diamonds.bson")
read_bson <- function(con, as_json = FALSE, verbose = TRUE){
read_bson <- function(con, as_json = FALSE, verbose = interactive()){
if(length(con) && is.character(con)){
con <- if(grepl("^https?://", con)){
url(con)
Expand Down
16 changes: 11 additions & 5 deletions man/read_bson.Rd

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

0 comments on commit 7b669e4

Please sign in to comment.