Comparing version 0.0.0 to 0.0.1
@@ -9,2 +9,6 @@ var util = require('util'); | ||
exports.Types = { | ||
ObjectID: ObjectID | ||
}; | ||
var config = { | ||
@@ -15,2 +19,3 @@ db: null | ||
function exports (o) { | ||
this._id = this._id || new ObjectID(); | ||
for(var i in o) { | ||
@@ -21,3 +26,2 @@ if (Object.hasOwnProperty.call(o, i)) { | ||
} | ||
this._id = this._id || new ObjectID(); | ||
} | ||
@@ -59,2 +63,11 @@ | ||
exports.findById = function (_id, callback) { | ||
return this.findOne({_id: new ObjectID(_id)}, callback); | ||
}; | ||
exports.findAndModify = function (query, sort, update, options, callback) { | ||
var collection = GC(this); | ||
return collection.findAndModify.apply(collection, arguments); | ||
}; | ||
exports.init = function (target, collection) { | ||
@@ -61,0 +74,0 @@ util.inherits(target, exports); |
{ | ||
"name": "mong", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Lightweight models for mongodb objects", | ||
"main": "lib/index", | ||
"scripts": { | ||
"test": "mocha --recursive" | ||
"test": "[[ -z $TRAVIS_JOB_ID ]] && mocha --recursive || npm run travis", | ||
"travis": "jscoverage lib lib-cov && MONG_COVERAGE=1 mocha --recursive -R mocha-lcov-reporter | coveralls && mocha --recursive", | ||
"coverage": "jscoverage lib lib-cov && MONG_COVERAGE=1 mocha --recursive -R html-cov > lib-cov/test.html && open lib-cov/test.html" | ||
}, | ||
@@ -9,0 +11,0 @@ "repository": { |
@@ -42,2 +42,5 @@ mongomodel | ||
``` | ||
``` | ||
[](https://travis-ci.org/aantthony/mong) [](https://coveralls.io/r/aantthony/mong?branch=master) |
@@ -1,2 +0,2 @@ | ||
var lib = require('../../lib'); | ||
var lib = require('../../index'); | ||
var should = require('should'); | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
var lib = require('../../lib'); | ||
var lib = require('../../index'); | ||
var should = require('should'); | ||
@@ -3,0 +3,0 @@ var sinon = require('sinon'); |
@@ -1,2 +0,2 @@ | ||
var lib = require('../../lib'); | ||
var lib = require('../../index'); | ||
var should = require('should'); | ||
@@ -3,0 +3,0 @@ |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
8812
13
179
45
2