On Thu, Jan 14, 2010 at 2:12 PM, Brian Candler <[email protected]> wrote: > On Thu, Jan 14, 2010 at 01:37:02PM -0600, Zachary Zolton wrote: >> What would a function (API, really) look like for importing CSV? > > Probably something like a cross between the _update and _list APIs: > > * raw data is passed in, parsing is completely the responsibility of the > user-written function (so it could be CSV, XML, or whatever) > > * it has a callback which lets it emit a stream of objects like _list, > and these are emitted as JSON docs and written to the database. > > More difficult would be to allow bulk *updates* via this mechanism, because > having parsed out the IDs you'd need to be able to fetch existing docs, > modify and write back. >
If the CSV source was responsible for tracking _revs then it could work easily. -- Chris Anderson http://jchrisa.net http://couch.io
