tg-query

2.0.3 • Public • Published

tg-query

Query Builder and Parser for the front and back end

Query Builder Usage:

import QueryBuilder from "tg-client-query-builder";
 
//make sure to instantiate the qb anew each time you want to use it
//If it isn't re-instantaited it will grow bigger and bigger!
let qb = new QueryBuilder("notificationRecipient"); //instantiate with the model name
const filter = qb.whereAll({
    userId: currentUser.userId, //make normal where statements like this
    notificationId: qb.related("notification.id").whereAll({ //specify the connection like this
        type: "info" //add more where statements
    })
}).toJSON() //remember to call toJSON

/tg-query/

    Package Sidebar

    Install

    npm i tg-query

    Weekly Downloads

    0

    Version

    2.0.3

    License

    MIT

    Last publish

    Collaborators

    • teselagen-admin