tg-query
v2.0.3
Published
Query Builder and Parser for the front and back end
Downloads
1
Readme
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