将 breeze 谓词应用于可观察数组中的数据

Apply breeze predicate to data in an observable array

我正在为我的实体执行 breeze 查询并将数据存储在浏览器本地缓存中。 如果我将来碰巧加载这些实体,我不会再次执行 breeze 查询,而是将数据从本地存储加载到可观察数组中。 我想知道如何通过应用 breeze 谓词来过滤这些可观察数组中的数据,因为我不会再次执行 breeze 查询。

是否可以在可观察数组上应用 breeze 谓词来过滤数据?

Breeze 能够 execute your query locally. For this to work you'll need to load the data from local storage into a breeze entity manager. There are several ways to do this (importEntities, attachEntity), the approach depends on how you are storing and retrieving your entities from local storage. It would make your life easier if you used exportEntities and importEntities 当 storing/retrieving 来自本地存储的实体数据时。如果您确实选择使用 exportEntites,请特别注意 includeMetadata 参数。您可能希望单独缓存元数据以保存 space.