stevendesu / jsindex

1 stars 0 forks source link

Array search does not copy indexes #11

Open stevendesu opened 5 years ago

stevendesu commented 5 years ago

It'd be convenient if searches could be chained. For instance:

const students = Array.load(...).index();

const spanishStudents = students.search({
    language: "Spanish"
});
const maleSpanishStudents = spanishStudents.search({
    gender: "male"
});

Currently this can only be done with a 2-element search like so:

const maleSpanishStudents = students.search({
    language: "Spanish",
    gender: "male"
});

However there are legitimate use cases for being able to do these searches separately.

Note: Just like how #3 may harm performance and therefore should be added as an opt-in (or opt-out) option, this may harm performance and should be added as an opt-in / opt-out option.