Skip to content

Commit 572580e

Browse files
author
hxoliverrumbelow
committed
Filter resources at the database level
1 parent e15aad9 commit 572580e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/mongoHandler.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use strict";
22
var _ = {
33
clone: require("lodash.clone"),
4-
omit: require("lodash.omit"),
5-
assign: require("lodash.assign")
4+
omit: require("lodash.omit")
65
};
76
var async = require("async");
87
var debug = require("./debugging");
@@ -31,7 +30,7 @@ MongoStore._isRelationshipAttribute = function(attribute) {
3130

3231

3332
MongoStore._toMongoDocument = function(resource) {
34-
var document = _.clone(resource, true);
33+
var document = _.omit(resource, function(value) { return value === undefined; });
3534
document._id = MongoStore._mongoUuid(document.id);
3635
return document;
3736
};

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"dependencies": {
2828
"async": "1.5.0",
2929
"debug": "2.2.0",
30-
"lodash.assign": "3.2.0",
3130
"lodash.clone": "3.0.3",
3231
"lodash.omit": "3.1.0",
3332
"mongodb": "2.0.48"

0 commit comments

Comments
 (0)