mongodb-schema
Advanced tools
Comparing version
@@ -15,3 +15,3 @@ /** | ||
function schema(documents, options) { | ||
var SCHEMA_VERSION = "0.5.2"; | ||
var SCHEMA_VERSION = "0.6.0"; | ||
@@ -215,8 +215,4 @@ /** | ||
var type_keys = Object.keys(schema[$t]); | ||
if (type_keys.length == 1) { | ||
if (type_keys[0] == 'object') { | ||
delete schema[$t]; | ||
} else { | ||
schema[$t] = type_keys[0]; | ||
} | ||
if (type_keys.length === 1) { | ||
schema[$t] = type_keys[0]; | ||
} | ||
@@ -454,2 +450,4 @@ } | ||
schema = _cleanup(schema); | ||
// always delete outermost #type | ||
delete schema[$t]; | ||
} | ||
@@ -456,0 +454,0 @@ |
{ | ||
"name": "mongodb-schema", | ||
"description": "Infer a probabilistic schema javascript objects, JSON documents or a MongoDB collection", | ||
"version": "0.5.2", | ||
"description": "Infer probabilistic schema of javascript objects or a MongoDB collection.", | ||
"version": "0.6.0", | ||
"author": "Thomas Rueckstiess <thomas@rueckstiess.net>", | ||
@@ -6,0 +6,0 @@ "license": "Apache", |
@@ -50,2 +50,3 @@ var schema = require('../').schema, | ||
"#count": 2, | ||
"#type": "object", | ||
"b": { | ||
@@ -52,0 +53,0 @@ "#count": 2, |
54021
-0.07%758
-0.13%