ez-query-builder-mongo

## Install

Usage no npm install needed!

<script type="module">
  import ezQueryBuilderMongo from 'https://cdn.skypack.dev/ez-query-builder-mongo';
</script>

README

QueryBuilder

Install

run yarn add ez-query-builder-mongo or npm i --save ez-query-builder-mongo

How to use

Input

import { queryBuilder } from "ez-query-builder-mongo";

const params = {
    _or: [
        { _and: [{ name:  "Eder" }, { age_in: [22,  23] }] },
        { _and: [{ name:  "Zadravec" }, { age_in: [22,  23] }] }
    ]
};

queryBuilder(params)

Output

{
    $or: [
        {
            $and: [
                { name: "Eder" },
                {
                    age: {
                        $in: [22,  23]
                    }
                }
            ]
        },
        {
            $and: [
                { name: "Zadravec" },
                {
                    age: {
                        $in: [22,  23]
                    }
                }
            ]
        }
    ],
}