Google chrome extension IndexedDB getAll()排序
我正在使用Google chrome extension IndexedDB getAll()排序,google-chrome-extension,firefox-addon,indexeddb,opera-extension,Google Chrome Extension,Firefox Addon,Indexeddb,Opera Extension,我正在使用getAll()方法从数据库中获取所有项 db.transaction('history', 'readonly').objectStore('history').getAll().onsuccess = ... MyObjectStore定义为: db.createObjectStore('history', { keyPath: 'id', autoIncrement: true }); 我能指望得到的项目的排序吗?它们是否总是按主键id排序? (或者有没有明确指定排序的方法?
getAll()
方法从数据库中获取所有项
db.transaction('history', 'readonly').objectStore('history').getAll().onsuccess = ...
MyObjectStore
定义为:
db.createObjectStore('history', { keyPath: 'id', autoIncrement: true });
我能指望得到的项目的排序吗?它们是否总是按主键id
排序?(或者有没有明确指定排序的方法?)
我在官方网站上找不到有关订购的任何信息如果这些文档没有帮助,请参考规范:
getAll
检索索引的第一个N,即它是顺序保留的。因此,结果本身应该保留排序顺序