Apache CouchDB is a document-oriented database that can be queried and indexed in a MapReduce fashion using JavaScript. With Emacs special file name handling, we can open, edit and save CouchDB document as normal file.
Filename to document map:
"/couchdb:host#port:/db/docid" => document with 'docid' in data base 'db' of couchdb server 'host:port'. "/couchdb:host:/db/docid" => 'port' is optional if it is `couchdb-document-port'(default 5984). "/couchdb:/db/docid" => 'host' is also optional if it is `couchdb-document-host'(default '127.0.0.1).
Usage of couchdb-document-text
(require 'couchdb-document-text) (find-file "/couchdb:/db/aaa.txt") ;; write something, then C-x C-s
;; or (find-file "/couchdb:/db/xxx.org.gpg") ;; write something, then C-x C-s
If couchdb-document.el is loaded before tramp.el, ‘file-name-handler-alist’ will then changed by tramp and Emacs will try to use tramp to load couchdb document, so it’s necessary to call ‘couchdb-document-register-file-name-handler’ after load tramp.el, a typical config will looks like below:
(require 'tramp)
(when (featurep 'couchdb-document)
(couchdb-document-register-file-name-handler))Unsupportted features:
‘find-file’ to open a couchdb document will cause unexpected result.‘insert-directory’ of couchdb document are not implemented, so it not works with dired.