Is it possible to search for multiple values using can-connect? For example if I want to get all Todo’s with status ‘open’ or ‘in-progress’ I would like to do something like:
Todo.getList({ status: ['open', 'in-progress'] })
Or if I wanted to get a bunch of Todo’s by id:
Todo.getList({ id: [1,3,4,6] })
Is there a way to do this with can-connect? The above will work once, but once you start requesting multiple lists errors start to occur:
unhandledRejection.js:23 Potentially unhandled rejection [3] TypeError: Cannot read property 'id' of undefined
at Object.id (http://localhost:8080/node_modules/can-connect/src/can-connect.js:181:22)
at http://localhost:8080/node_modules/can-connect/src/data/localstorage-cache/localstorage-cache.js:141:19
at Array.map (native)
at Object.updateSet (http://localhost:8080/node_modules/can-connect/src/data/localstorage-cache/localstorage-cache.js:140:18)
at http://localhost:8080/node_modules/can-connect/src/data/localstorage-cache/localstorage-cache.js:358:12
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:109:15
at Task.run (http://localhost:8080/node_modules/can-zone/lib/zone.js:39:17)
at Zone.runTask (http://localhost:8080/node_modules/can-zone/lib/zone.js:176:14)
at http://localhost:8080/node_modules/can-zone/lib/zone.js:270:15
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:121:21(anonymous function) @ unhandledRejection.js:23report @ unhandledRejection.js:50flush @ unhandledRejection.js:72
unhandledRejection.js:23 Potentially unhandled rejection [5] TypeError: Cannot read property 'id' of undefined
at Object.id (http://localhost:8080/node_modules/can-connect/src/can-connect.js:181:22)
at http://localhost:8080/node_modules/can-connect/src/data/localstorage-cache/localstorage-cache.js:141:19
at Array.map (native)
at Object.updateSet (http://localhost:8080/node_modules/can-connect/src/data/localstorage-cache/localstorage-cache.js:140:18)
at http://localhost:8080/node_modules/can-connect/src/data/localstorage-cache/localstorage-cache.js:358:12
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:109:15
at Task.run (http://localhost:8080/node_modules/can-zone/lib/zone.js:39:17)
at Zone.runTask (http://localhost:8080/node_modules/can-zone/lib/zone.js:176:14)
at http://localhost:8080/node_modules/can-zone/lib/zone.js:270:15
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:121:21(anonymous function) @ unhandledRejection.js:23report @ unhandledRejection.js:50flush @ unhandledRejection.js:72
unhandledRejection.js:23 Potentially unhandled rejection [7] TypeError: Cannot read property 'length' of undefined
at Object.hydrateList (http://localhost:8080/node_modules/can-connect/src/constructor/constructor.js:204:36)
at Object.hydrateList (http://localhost:8080/node_modules/can-connect/src/constructor/store/store.js:449:39)
at Object.hydrateList (http://localhost:8080/node_modules/can-connect/src/fall-through-cache/fall-through-cache.js:98:39)
at http://localhost:8080/node_modules/can-connect/src/constructor/constructor.js:176:17
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:109:15
at Task.run (http://localhost:8080/node_modules/can-zone/lib/zone.js:39:17)
at Zone.runTask (http://localhost:8080/node_modules/can-zone/lib/zone.js:176:14)
at http://localhost:8080/node_modules/can-zone/lib/zone.js:270:15
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:121:21
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:109:15(anonymous function) @ unhandledRejection.js:23report @ unhandledRejection.js:50flush @ unhandledRejection.js:72
unhandledRejection.js:23 Potentially unhandled rejection [8] TypeError: Cannot read property 'length' of undefined
at Object.hydrateList (http://localhost:8080/node_modules/can-connect/src/constructor/constructor.js:204:36)
at Object.hydrateList (http://localhost:8080/node_modules/can-connect/src/constructor/store/store.js:449:39)
at Object.hydrateList (http://localhost:8080/node_modules/can-connect/src/fall-through-cache/fall-through-cache.js:98:39)
at http://localhost:8080/node_modules/can-connect/src/constructor/constructor.js:176:17
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:109:15
at Task.run (http://localhost:8080/node_modules/can-zone/lib/zone.js:39:17)
at Zone.runTask (http://localhost:8080/node_modules/can-zone/lib/zone.js:176:14)
at http://localhost:8080/node_modules/can-zone/lib/zone.js:270:15
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:121:21
at http://localhost:8080/node_modules/can-zone/lib/tasks.js:109:15