Couchapp 目录结构,更新吗?
生成新的 couchapp 时,我得到以下结构:
appname
├── _attachments
│ └── style
├── evently
│ ├── items
│ │ └── _changes
│ └── profile
│ └── profileReady
│ └── selectors
│ └── form
├── lists
├── shows
├── updates
├── vendor
│ └── couchapp
│ ├── _attachments
│ ├── evently
│ │ ├── account
│ │ │ ├── adminParty
│ │ │ ├── loggedIn
│ │ │ ├── loggedOut
│ │ │ ├── loginForm
│ │ │ │ └── selectors
│ │ │ │ └── form
│ │ │ └── signupForm
│ │ │ └── selectors
│ │ │ └── form
│ │ └── profile
│ │ ├── loggedOut
│ │ ├── noProfile
│ │ │ └── selectors
│ │ │ └── form
│ │ └── profileReady
│ └── lib
└── views
└── recent-items
现在,由于此结构旨在反映 CouchDB _design 文档的 JSON 结构,所以我发现了这一点:
-
[_attachments] 附件以二进制形式存储。 JavaScript、CSS 和 HTML 文件存储在此处。
-
[事件]???
-
[lists] 列表是 JavaScript 函数,执行这些函数可从视图结果中呈现 HTML 或 AtomFeeds。
-
[shows] Show 函数类似于列表函数,但通过将文档转换为其他格式(例如 html、xml、csv、png)来呈现内容。
-
[更新]???
-
[vendor]外部库的主页。
-
[views]View 包含稍后可以通过 HTTP API 查询的 MapReduce 函数(请参阅 \ref{couchdb:views})。
除了我希望填写的描述没有完全错误之外,我将如何描述更新目录?这是托管验证功能吗?
第二个问题是您将如何描述 evently 目录...
如果已经存在该目录的摘要,请指出它!
亲切的问候!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
generate
命令构建 CouchDB 所需的主干文档格式;它还构建了一个 Web 应用程序开发框架 Evently。我不太了解Evently;但基本上它为开发人员提供了使 UI 和沙发交互的工具和建议。就我个人而言,我从不使用
couchapp
生成命令。我只是从头开始创建_id
文件 (echo -n _design/whatever > _id
),然后根据需要创建文件夹和文件。列表函数(每个文件一个)接收
_view
输出以生成任何 HTTP 响应(例如 XML RSS)。显示函数(每个文件一个)接收一个文档以产生任何 HTTP 响应。
更新函数(每个文件一个)接收一个 HTTP 查询并输出一份准备好的文档以由 couch 存储。 (例如,接收表单提交并构建 JSON 文档。)
视图函数(文件夹中的一个
map.js
和一个reduce.js
)是 CouchDB 视图,并提供用于查询和其他内容。我不确定
更新
和供应商
。它们与 CouchDB 服务器无关。The
generate
command builds the backbone document format that CouchDB needs; and it also builds a web app development framework, Evently. I don't know Evently very well; but basically it gives a developer tools and suggestions to make the UI and the couch interact.Personally, I never use the
couchapp
generate command. I just create the_id
file from scratch (echo -n _design/whatever > _id
), then create folders and files as I need them.List functions (one per file) receive
_view
output to produce any HTTP response (e.g. XML RSS).Show functions (one per file) receive a one document to produce any HTTP repsonse.
Update functions (one per file) receive one HTTP query and output one prepared document to be stored by couch. (For example, receiving a form submission and building a JSON document.)
View functions (one
map.js
and onereduce.js
in a folder) are CouchDB views and provide for the querying and stuff.I'm not sure about
updates
andvendor
. They aren't relevant to the CouchDB server.我已经使用 couchapp 大约一两周了。我花了一段时间才掌握 couchDB 的工作原理以及 couchapp 的适用方式。事实上,我也有你所遇到的问题,我确信现在每个 couchapp 的新手都会有这些问题萦绕在他们的脑海中。至少为了节省他们的时间,我发布了一些有助于更好地回答您提出的问题的链接。链接如下:
希望他们有所帮助。
I have been using couchapp for about a week or two now. It took me more than a while to get the grasp of how couchDB works and how couchapp fits. In fact, I was having the very questions that you were having and I'm sure now that every newbie to couchapp will have these questions lingering in their mind. To save their time at least, I'm posting some of the links that helped be get better at answering the very questions you have asked for. And the links are as below:
Hope they help.
更新函数记录在 CouchDB wiki 中。引用它:
Evently 在 CouchApp 网站上有记录。文档很弱,我在一个项目中使用它,我只找到了 一个简短的博客发布有用信息的帖子。幸运的是源代码是容易理解。但请查看 Pages 应用程序以获取示例用法。无论如何,我不清楚使用了多少。
Update functions are documented in the CouchDB wiki. Quoting it:
Evently is documented on CouchApp site. Documentation is weak, I am using it in a project and I have found only a short blog post with useful info. Luckily the source code is easy to understand. But look at Pages app for sample usage. Anyway it is not clear to me how much used is it.