+ public addNotIn(field: string, value?: string | string[], resourcePrefix?: string) {
+ return this.addCondition(field, "not in", value, "", "", resourcePrefix);
+ }
+
+ public addGt(field: string, value?: string, resourcePrefix?: string) {
+ return this.addCondition(field, ">", value, "", "", resourcePrefix);
+ }
+
+ public addGte(field: string, value?: string, resourcePrefix?: string) {
+ return this.addCondition(field, ">=", value, "", "", resourcePrefix);
+ }
+
+ public addLt(field: string, value?: string, resourcePrefix?: string) {
+ return this.addCondition(field, "<", value, "", "", resourcePrefix);
+ }
+
+ public addLte(field: string, value?: string, resourcePrefix?: string) {
+ return this.addCondition(field, "<=", value, "", "", resourcePrefix);
+ }
+
+ public addExists(value?: string, resourcePrefix?: string) {
+ return this.addCondition("properties", "exists", value, "", "", resourcePrefix);
+ }
+ public addDoesNotExist(field: string, resourcePrefix?: string) {
+ return this.addCondition("properties." + field, "exists", false, "", "", resourcePrefix);
+ }
+
+ public addFullTextSearch(value: string, table?: string) {
+ const regex = /"[^"]*"/;
+ const matches: any[] = [];
+
+ let match = value.match(regex);
+
+ while (match) {
+ value = value.replace(match[0], "");
+ matches.push(match[0].replace(/"/g, ''));
+ match = value.match(regex);
+ }
+
+ let searchIn = 'any';
+ if (table) {
+ searchIn = table + ".any";
+ }
+
+ const terms = value.trim().split(/(\s+)/).concat(matches);
+ terms.forEach(term => {
+ if (term !== " ") {
+ this.addCondition(searchIn, "ilike", term, "%", "%");
+ }
+ });
+ return this;
+ }
+