getList
Returns the matching items from the store
Store.getList( set )
Returns the matching items from the store like: {filter: [...]}
.
import {QueryLogic, fixture} from "can";
import {Todo} from "//unpkg.com/can-demo-models@5";
const todoQueryLogic = new QueryLogic( Todo );
const todoStore = fixture.store( [
{id: 1, name: "Do the dishes", complete: true},
{id: 2, name: "Walk the dog", complete: false},
{id: 3, name: "dry the dishes", complete: false},
], todoQueryLogic );
const result = todoStore.getList( {filter: {complete: false}} );
console.log( result.data ); //-> [
// {id: 2, name: "Walk the dog", complete: false},
// {id: 3, name: "dry the dishes", complete: false}
// ]
Parameters
- set
{Object}
:A Query.
Returns
{Object}
:
A serialized object. The data
parameter contains a list of records from the store.