Skip to content

Commit

Permalink
remove match mongoose/implementation details.
Browse files Browse the repository at this point in the history
  • Loading branch information
au2 committed Jun 20, 2014
1 parent b434a8f commit fb8f6d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var async = require('async');

var section = require('./section');
var entry = require('./entry');
var modelutil = require('./modelutil');

exports.save = function(dbinfo, secName, input, callback) {
var Model = dbinfo.matchModels[secName];
Expand All @@ -19,6 +20,12 @@ exports.get = function(dbinfo, secName, id, callback) {
if (err) {
callback(err);
} else {
modelutil.mongooseCleanSection(result.entry_id);
modelutil.mongooseCleanSection(result.match_entry_id);
delete result.__v;
delete result.patKey;
delete result.entry_id.metadata;
delete result.match_entry_id.metadata;
callback(null, result);
}
});
Expand All @@ -34,6 +41,10 @@ exports.getAll = function(dbinfo, secName, ptKey, fields, callback) {
var filteredResults = results.filter(function(result) {
return result.determination === undefined;
});
filteredResults.forEach(function(result) {
delete result.__v;
delete result.patKey;
});
callback(null, filteredResults);
}
});
Expand Down

0 comments on commit fb8f6d4

Please sign in to comment.