You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So it will always be a dataframe or a list of dataframe?
That raises the following questions:
how do I prevent find() from returning a dataframe ?
How can I return something else using a handler?
the end of mongo_stream_in is
if (is.null(handler)) {
if (verbose)
cat("\r Imported", count, "records. Simplifying into dataframe...\n")
out <- as.list(out, sorted = FALSE)
post_process(unlist(out[order(as.numeric(names(out)))],
FALSE, FALSE))
}
else {
invisible()
}
so if the handler is defined, nothing is returned?
My use case is the following :
con<-mongolite::mongo()
con$drop()
con$insert(
list( y=data.frame(x=1) )
)
# I want this to return list( y = data.frame(x = 1) )con$find()
con$insert(
list( z=data.frame(x=1) )
)
# I don't want this to return a data.framecon$find()
To sum up, I don't want the automatic dataframe conversion.
How do we achieve that in find?
The text was updated successfully, but these errors were encountered:
It's unclear how
find(handler = )
works.The documentation says:
Which seems to imply that defining another handler would allow to return something else than a single dataframe.
Digging into the code,
mongo_stream_in
does the following:meaning that
handler()
is always called withpost_process()
, which does:So it will always be a dataframe or a list of dataframe?
That raises the following questions:
the end of
mongo_stream_in
isso if the handler is defined, nothing is returned?
My use case is the following :
To sum up, I don't want the automatic dataframe conversion.
How do we achieve that in find?
The text was updated successfully, but these errors were encountered: