Comparing version 3.0.6 to 3.0.7
@@ -31,2 +31,16 @@ 'use strict'; | ||
/** | ||
* Gets one option from the object and returns it. | ||
* @private | ||
*/ | ||
function getOption(name, options, defaultValue) { | ||
var option = defaultValue; | ||
if (options) { | ||
if (options.hasOwnProperty(name)) { | ||
option = options[name]; | ||
} | ||
} | ||
return option; | ||
} | ||
/** | ||
* Creates a new Document Model class | ||
@@ -209,2 +223,3 @@ * | ||
var pluck = extractOption('pluck', options); | ||
var wantCursor = getOption('cursor', options); | ||
@@ -222,2 +237,6 @@ if (pluck !== undefined) { | ||
if (wantCursor) { | ||
return callback(null, documentsLoaded); | ||
} | ||
var i, len; | ||
@@ -224,0 +243,0 @@ if (hasFields) { |
@@ -33,2 +33,16 @@ 'use strict'; | ||
/** | ||
* Gets one option from the object and returns it. | ||
* @private | ||
*/ | ||
function getOption(name, options, defaultValue) { | ||
var option = defaultValue; | ||
if (options) { | ||
if (options.hasOwnProperty(name)) { | ||
option = options[name]; | ||
} | ||
} | ||
return option; | ||
} | ||
/** | ||
* Creates a new Document Model class | ||
@@ -292,2 +306,3 @@ * | ||
var pluck = extractOption('pluck', options); | ||
var wantCursor = getOption('cursor', options); | ||
@@ -305,2 +320,6 @@ if (pluck !== undefined) { | ||
if (wantCursor) { | ||
return callback(null, documentsLoaded); | ||
} | ||
var i, len; | ||
@@ -307,0 +326,0 @@ if (hasFields) { |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"engines": { | ||
@@ -11,0 +11,0 @@ "node": ">=0.4.12" |
65680
2070