CouchDB 可以将纯文本本地转换为 json 格式吗?

Can CouchDB natively convert plain text to json format?

我知道有 python 和 powershell 方法可以将纯文本文件、csv 等转换为 json 格式,以便上传到 CouchDB 等 NoSQL 数据库中。

但根据 CouchDB 权威指南,似乎有一种本机内置的方式可以进行这种转换,而无需第三方工具。

这个较旧的线程似乎暗示了这一点: Filter and update functions in CouchDB?

特别是这部分:

There are other design document functions that are being introduced at the >time of this writing, including _update and _filter that we aren’t covering in >depth here. Filter functions are covered in Chapter 20, Change Notifications. >Imagine a web service that POSTs an XML blob at a URL of your choosing when >particular events occur. PayPal’s instant payment notification is one of >these. With an _update handler, you can POST these directly in CouchDB and it >can parse the XML into a JSON document and save it. The same goes for CSV, >multi-part form, or any other format.

但是当我深入挖掘时,我没有找到任何具体的东西。 支持的 wiki link 对我来说不是很清楚(json/NoSQL/curl 的初学者:http://wiki.apache.org/couchdb/Document_Update_Handlers

希望这是一个简单的 yes/no。任何比上述 link 更好的帮助 link 也很感激,谢谢!

CouchDB 支持通过使用 show and list 函数将内部 documents/views 转换为许多其他格式。这不是 "native" 转换,因为你自己定义转换,它并不神奇。

也就是说,没有类似的反向机制(即:将一些任意格式转换为 JSON 文档),但是最好使用功能齐全的 language/script 并使用 bulk docs API 批量导入。