Closed richfitz closed 2 years ago
I guess it depends a bit to what extend other back-ends can also support this. I think docdbi
should define mostly generic nosql logic, not too much stuff specific to a particular implementation. Mongo indeed supports query (filter), sort, limit, select, etc.
So, the way to do this would be to allow different backends to support different sets of operations; we have a set of required operations (currently create/get/delete) but we could allow different drivers to implement or not other features, and can fall back on R-based ones perhaps (so the default methods would get the whole data.frame and slice and dice in R).
But that's all orthogonal to where support would go. I think DBI does many functions rather than many args. That'd be easiest to support.
sofa
yetsee also #3
docdb_query()
now accepts parameters query
and fields
(in MongoDB syntax), which work across databases (CouchDB, Elasticsearch, MongoDB, SQLite, PostgreSQL) to retrieve selected documents and selected fields, as per 219b123fd9fed88d8aea1fda90d5ddc4bcbc098c. See also https://github.com/ropensci/nodbi#walk-through.
It looks like the mongodb driver has support for selecting columns of the data.frame on export; how should we present this generally so that other drivers can support it in a consistent way? Options seem to be: arguments to
docdbi_get
or havedocdbi_select
which allows potentially more efficient bulk gets? At the same time we're going to want filtering too, right?