Skip to content

Commit

Permalink
feat: parseRegex expresion function to seperate pattern from options
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Jan 13, 2024
1 parent 42605ac commit 9401b07
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ async function createFilter(data, arrayObj) {
}


// TODO: improve mongodb query to cover many cases
// TODO: improve mongodb query to cover many of mongodb query cases
function createQuery(queries) {
let query = new Object();

Expand Down Expand Up @@ -760,6 +760,14 @@ function createQuery(queries) {
return query;
}

function parseRegExp(regExpString) {
let matches = regExpString.match(/\/(.*)\/(.*)/);
return {
pattern: matches[1],
options: matches[2]
};
}

function createProjection(data) {
let projection = {}

Expand Down

0 comments on commit 9401b07

Please sign in to comment.