gun-mongo-key
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -1,2 +0,2 @@ | ||
const {Flint, KeyValAdapter, Mixins} = require('gun-flint'); | ||
const {KeyValAdapter, Mixins} = require('gun-flint'); | ||
const Mongojs = require('mongojs'); | ||
@@ -12,3 +12,3 @@ | ||
Flint.register(new KeyValAdapter({ | ||
var gunMongoKey = new KeyValAdapter({ | ||
initialized: false, | ||
@@ -76,3 +76,3 @@ written: 0, | ||
// Find a single field | ||
this._streamResults(this._getCollection(key).find({_id: getKeyField(key, field)}).limit(1), stream); | ||
this._streamResults(this._getCollection().find({_id: getKeyField(key, field)}).limit(1), stream); | ||
}, | ||
@@ -91,3 +91,3 @@ | ||
// Find an entire nodes key:val, stream results | ||
this._streamResults(this._getCollection(key).find({key}), stream); | ||
this._streamResults(this._getCollection().find({key}), stream); | ||
}, | ||
@@ -106,2 +106,4 @@ | ||
let queryErr = null; | ||
let internalErr = this.errors.internal; | ||
let notFount = this.errors.lost; | ||
result | ||
@@ -119,6 +121,10 @@ .on('data', function(data) { | ||
queryErr = err; | ||
streamOut.done(queryErr ? this.errors.internal : null); | ||
if (!err && !hasResult) { | ||
streamOut.done(notFount); | ||
} else { | ||
streamOut.done(queryErr ? internalErr : null); | ||
} | ||
}) | ||
.on('close', function() { | ||
streamOut.done(queryErr ? this.errors.internal : null); | ||
streamOut.done(queryErr ? internalErr : null); | ||
}); | ||
@@ -135,3 +141,2 @@ }, | ||
if (this.initialized && batch.length) { | ||
// Essential info | ||
@@ -177,2 +182,4 @@ let written = 0; | ||
} | ||
})); | ||
}); | ||
module.exports = gunMongoKey; |
{ | ||
"name": "gun-mongo-key", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "A Mongo key:value adapter for Gunjs", | ||
"main": "gun-mongo-key.js", | ||
"main": "index.js", | ||
"repository": { | ||
@@ -19,2 +19,5 @@ "type": "git", | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "flint test ./gun-mongo-key.js --opt=./flint-opt.js" | ||
}, | ||
"bugs": { | ||
@@ -27,7 +30,3 @@ "url": "https://github.com/sjones6/gun-mongo-key/issues" | ||
"mongojs": "^2.4.0" | ||
}, | ||
"devDependencies": { | ||
"expect": "^1.20.2", | ||
"mocha": "^3.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
0
9
168
21746