Database “我是怎么想的?”;IndexedDB";?
假设我的商店里有3个条目Database “我是怎么想的?”;IndexedDB";?,database,html,indexeddb,Database,Html,Indexeddb,假设我的商店里有3个条目 { category: "Science", author: "Charles Darwin", content: "Lorem ipsum dolor..." } { category: "Science", author: "Albert Einstein", content: "sit amet..." } { category: "Philosophy", author: "Albert Einstein", conten
{
category: "Science",
author: "Charles Darwin",
content: "Lorem ipsum dolor..."
}
{
category: "Science",
author: "Albert Einstein",
content: "sit amet..."
}
{
category: "Philosophy",
author: "Albert Einstein",
content: "consectetur adipisicing elit..."
}
- 是否可以获取所有条目
,而无需在category上创建索引“其中category='Science'”
- 是否有可能获取所有条目,其中category='Science'和author='Albert Einstein'
- 是否可以获取所有包含单词
的条目是内容字段“Lorem”
- 或者我应该为这些类型的查询使用不同的数据库吗
如果您需要执行大量类似这样的查询(或者,上帝禁止,甚至更复杂的查询),并且您可以选择使用不同的数据库,那么请使用不同的数据库。但是你可能没有这个选择,这取决于你想要完成的任务。我的目标是创建一个客户端脱机应用程序(供个人使用,因此浏览器兼容性不是问题),但是LocalStorage太简单了,IndexedDB在a**中很难使用,WebSQL似乎不是理想的解决方案。无论如何,非常感谢你的回答,它真的帮助我理解了IndexedDB的哲学。