Skip to content

Commit da4b089

Browse files
committed
Merge branch 'release/1.3.5'
2 parents 99d0315 + 06eb311 commit da4b089

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/tree.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = exports = tree;
1717
function tree(schema, options) {
1818

1919
var pathSeparator = options && options.pathSeparator || '#'
20+
, wrapChildrenTree = options && options.wrapChildrenTree
2021
, onDelete = options && options.onDelete || 'DELETE' //'REPARENT'
2122
, numWorkers = options && options.numWorkers || 5
2223
, idType = options && options.idType || Schema.ObjectId
@@ -360,7 +361,10 @@ function tree(schema, options) {
360361
options.sort = {};
361362
}
362363
options.sort.path = 1;
363-
options.lean = true;
364+
365+
if (options.lean == null) {
366+
options.lean = !wrapChildrenTree;
367+
}
364368

365369
return this.find(filters, fields, options, function (err, results) {
366370

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"url": "git://github.com/swayf/mongoose-path-tree.git"
1717
},
1818
"main": "index.js",
19-
"version": "1.3.4",
19+
"version": "1.3.5",
2020
"engine": "node >= 0.8.0",
2121
"dependencies": {
2222
"mongoose": "3.8.x",

0 commit comments

Comments
 (0)