diff --git a/lib/Model.js b/lib/Model.js index 09f18ce..8b42e9b 100644 --- a/lib/Model.js +++ b/lib/Model.js @@ -80,13 +80,15 @@ function Model(database, collection, schema, options) { enumerable: false }); + var _instance = null; Object.defineProperty(this, 'Instance', { - value: Instance.forModel(this), + get: function() { return _instance = _instance || Instance.forModel(this) }, enumerable: false }); + var _cache = options.cache; Object.defineProperty(this, 'cache', { - value: options.cache || new NoOpCache(), + get: function() { return _cache = _cache || new NoOpCache(); }, enumerable: false }) diff --git a/package.json b/package.json index da09f37..0d97eeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iridium", - "version": "2.9.2", + "version": "2.9.3", "author": "Benjamin Pannell ", "description": "A custom lightweight ORM for MongoDB designed for power-users", "homepage": "https://sierrasoftworks.com/iridium", @@ -28,5 +28,15 @@ "devDependencies": { "mocha": "*", "should": "*" - } + }, + + "keywords": [ + "mongodb", + "orm", + "odm", + "iridium", + "validation", + "transformation", + "preprocessing" + ] } \ No newline at end of file