kuery

Simple Mongo-like queries with lo-dash, at the moment the operators are very limited...

Usage no npm install needed!

<script type="module">
  import kuery from 'https://cdn.skypack.dev/kuery';
</script>

README

kuery

Simple Mongo-like queries with lo-dash, at the moment the operators are very limited...

var collection =  [
    {id:1, name:'Andreas',address:{street:'Bellmansgatan'}},
    {id:2, name:'Sven'},
    {id:3, name:'Christian'},
    {id:4, name:'Emil'},
];

        var q = new Kuery({id:{$in:[1,2]}});
        q.find(collection).length.should.equal(2);
        
        var q = new Kuery({"address.street":"Bellmansgatan"});
        q.find(collection).length.should.equal(1);