File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,6 +160,8 @@ const buildQueryDoc = (node, cursor) => {
160160
161161 // single value leaf ops insert op node below given path
162162 // -> { 'param.path': { '$op': value } }
163+ case 'regex' :
164+ case 'contains' :
163165 case 'exists' :
164166 case 'gt' :
165167 case 'lt' :
Original file line number Diff line number Diff line change @@ -243,6 +243,18 @@ module.exports = class Query {
243243 return this // enable chaining
244244 }
245245
246+ contains ( value ) { // @leaf `{$contains: a}`
247+ const op = { op : 'contains' , param : this . cloneWhere ( ) , value : value }
248+ this . currentMatch . push ( op )
249+ return this // enable chaining
250+ }
251+
252+ regex ( value ) { // @leaf `{$regex: a}`
253+ const op = { op : 'regex' , param : this . cloneWhere ( ) , value : value }
254+ this . currentMatch . push ( op )
255+ return this // enable chaining
256+ }
257+
246258 exists ( flag ) { // @leaf `{$eq: a}`
247259 const does = flag === true || flag === undefined // defaults to true
248260 const op = { op : 'exists' , param : this . cloneWhere ( ) , value : does }
You can’t perform that action at this time.
0 commit comments