如何使用 pouchdb 构建 "blog like" 结构
How to build a "blog like" structure with pouchdb
我不确定像 pouchdb 中的数据库结构这样的博客的最佳方法是什么。我正在使用 ionic。
在常规 sql 数据库中,我会有一个 类别 table 和一个 条目 table 每个条目都具有唯一的 id
字段和 indexes
诸如“类别" 在 条目上 table.
因为 pouchdb 没有 tables
,我应该使用 pouchdb 数据库作为 table 等价物吗?
有更好的方法吗?需要注意的是,类别也可以删除。
您可以在数据库中的文档中定义一个唯一的字段,例如 "blog_category": "Horses" 并使用它来创建与之匹配的博客条目列表。 CouchDB 在这方面非常高效。
看看:https://github.com/nolanlawson/pouchdb-quick-search and other plugins available here: https://pouchdb.com/external.html 这可能对您来说很容易。
这是另一个很好的 link,其中包含有关结果分页的信息:https://pouchdb.com/2014/04/14/pagination-strategies-with-pouchdb.html
我不确定像 pouchdb 中的数据库结构这样的博客的最佳方法是什么。我正在使用 ionic。
在常规 sql 数据库中,我会有一个 类别 table 和一个 条目 table 每个条目都具有唯一的 id
字段和 indexes
诸如“类别" 在 条目上 table.
因为 pouchdb 没有 tables
,我应该使用 pouchdb 数据库作为 table 等价物吗?
有更好的方法吗?需要注意的是,类别也可以删除。
您可以在数据库中的文档中定义一个唯一的字段,例如 "blog_category": "Horses" 并使用它来创建与之匹配的博客条目列表。 CouchDB 在这方面非常高效。
看看:https://github.com/nolanlawson/pouchdb-quick-search and other plugins available here: https://pouchdb.com/external.html 这可能对您来说很容易。
这是另一个很好的 link,其中包含有关结果分页的信息:https://pouchdb.com/2014/04/14/pagination-strategies-with-pouchdb.html