I am using Lawnchair to store data locally on my client. The key I am using to insert values is created server-side.
Currently when I use .all the list of returned values is an array indexed from 0. I then iterate over this list storing returned values in an object literal (using underscore.js).
var objects = {};
_.each(returnedArray, function (val) {
objects[val.key] = val;
});
This allows me to use O(1) lookups in other parts of my code, but requires an O(n) operation on all reads from Lawnchair.
Is it possible to configure Lawnchair (or to use a different method / combination of methods) to return a key indexed object literal without iterating over my entire dataset?