Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongolass

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongolass - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

4

changelog.md

@@ -0,1 +1,5 @@

## 2.2.0/2016-10-04
- add default `_id` schema when register a new schema
## 2.1.0/2016-09-18

@@ -2,0 +6,0 @@

@@ -5,4 +5,11 @@ 'use strict';

const Schema = require('another-json-schema');
const Types = require('./Types');
exports.Schema = Schema;
class _Schema extends Schema {
constructor(name, schema) {
super(name, _.defaults(schema, { _id: { type: Types.ObjectId } }));
}
}
exports.Schema = _Schema;
exports._plugins = function _plugins(schema) {

@@ -9,0 +16,0 @@ return {

2

package.json
{
"name": "mongolass",
"version": "2.1.0",
"version": "2.2.0",
"description": "Elegant MongoDB driver for Node.js.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -37,3 +37,3 @@ 'use strict';

}
assert.deepEqual(error.message, 'Already connected to mongodb://localhost:27017/test, please create another connection.');
assert.deepEqual(error.message, 'Already connected to ' + MONGODB + ', please create another connection.');
});

@@ -72,4 +72,13 @@

});
assert.ok(UserSchema._schema._id);
assert.ok(UserSchema instanceof Schema);
assert.ok(UserSchema === mongolass.schema('User'));
UserSchema = new Schema('User', {
name: { type: 'string' },
age: { type: 'number', range: [0, 100] }
});
assert.ok(UserSchema._schema._id);
assert.ok(UserSchema instanceof Schema);
try {

@@ -76,0 +85,0 @@ UserSchema = mongolass.schema('User2');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc