Skip to content

Commit aaef9a8

Browse files
committed
exporting convert function, releasing new version
1 parent 91f7f03 commit aaef9a8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ var pathToText = function(path, isString) {
1919
}
2020
return text;
2121
}
22+
var convertDotNotation = function(path, pathDotNotation) {
23+
return pathToText([path].concat(pathDotNotation.split('.')), true);
24+
}
2225

2326
// These are the simple operators.
2427
var ops = {
@@ -92,4 +95,5 @@ var convert = function (path, query) {
9295

9396
module.exports = function (fieldName, query) {
9497
return convert([fieldName], query);
95-
};
98+
};
99+
module.exports.convertDotNotation = convertDotNotation

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongo-query-to-postgres-jsonb",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Converts MongoDB queries to postgresql queries for jsonb fields.",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)