mongodb-query-parser
Advanced tools
Comparing version
@@ -23,2 +23,5 @@ const EJSON = require('mongodb-extended-json'); | ||
}, | ||
ObjectId: function(v) { | ||
return `ObjectId('${v.toHexString()}')`; | ||
}, | ||
Binary: function(v) { | ||
@@ -91,7 +94,2 @@ return `Binary('${v.buffer.toString('base64')}', '${v.sub_type.toString( | ||
// TODO Cache parsing. | ||
// const createLRUCache = require('lru-cache'); | ||
// const parseProjectCache = createLRUCache({max: 100}); | ||
// const parseFilterCache = createLRUCache({max: 100}); | ||
function executeJavascript(input, sandbox) { | ||
@@ -133,4 +131,8 @@ sandbox = sandbox || {}; | ||
MinKey: bson.MinKey, | ||
ObjectID: bson.ObjectID, | ||
ObjectId: bson.ObjectId, | ||
ObjectID: function(v) { | ||
return new bson.ObjectId(v); | ||
}, | ||
ObjectId: function(v) { | ||
return new bson.ObjectId(v); | ||
}, | ||
Symbol: bson.Symbol, | ||
@@ -137,0 +139,0 @@ Timestamp: bson.Timestamp, |
{ | ||
"name": "mongodb-query-parser", | ||
"description": "Parse MongoDB queries", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "fmt": "mongodb-js-fmt", |
286
1.06%21252
-0.13%