Skip to content

Commit 275b6af

Browse files
added split and member to woql
1 parent a44a0e1 commit 275b6af

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/woql.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ WOQL.pad = function(input, pad, len, output){ return new WOQLQuery().pad(input,
326326
*/
327327
WOQL.join = function(input, glue, output){ return new WOQLQuery().join(input, glue, output); }
328328

329+
WOQL.split = function(input, glue, output){ return new WOQLQuery().split(input, glue, output); }
330+
WOQL.member = function(El, List){ return new WOQLQuery().member(El, List); }
331+
332+
329333
/**
330334
* Generates an ID for a node as a function of the passed VariableList with a specific prefix (URL base). If the values of the passed variables are the same, the output will be the same
331335
* @param {string} prefix - prefix for the id
@@ -900,12 +904,25 @@ WOQLQuery.prototype.pad = function(input, pad, len, output){
900904
return this;
901905
}
902906

907+
WOQLQuery.prototype.member = function(El, List){
908+
this.cursor['member'] = [El, List];
909+
return this;
910+
}
911+
903912
WOQLQuery.prototype.join = function(input, glue, output){
904913
glue = this.packString(glue);
905914
this.cursor['join'] = [input, glue, output];
906915
return this;
907916
}
908917

918+
WOQLQuery.prototype.split = function(input, glue, output){
919+
glue = this.packString(glue);
920+
input = this.packString(input);
921+
this.cursor['split'] = [input, glue, output];
922+
return this;
923+
}
924+
925+
909926
WOQLQuery.prototype.less = function(v1, v2){
910927
v1 = (v1.json ? v1.json() : v1);
911928
v2 = (v2.json ? v2.json() : v2);

lib/woqlClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ WOQLClient.prototype.update = function (qurl, woql, opts) {
323323
let q = {'terminus:query' : JSON.stringify(woql), ...fileList};
324324

325325
q = this.addOptionsToWOQL(q, opts);
326-
return this.dispatch(this.connectionConfig.queryURL(), CONST.WOQL_UPDATE, q);
326+
return this.dispatch(this.connectionConfig.queryURL(), CONST.WOQL_SELECT, q);
327327
};
328328

329329
/**

0 commit comments

Comments
 (0)