Skip to content

Commit

Permalink
fix(discriminator): don't treat $meta as defining projection when que…
Browse files Browse the repository at this point in the history
…rying

Fix #5859
  • Loading branch information
vkarpov15 committed Dec 8, 2017
1 parent 7c355b0 commit 107b838
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/queryhelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

var get = require('lodash.get');
var isDefiningProjection = require('./services/projection/isDefiningProjection');
var utils = require('./utils');

/*!
Expand Down Expand Up @@ -90,7 +91,8 @@ exports.applyPaths = function applyPaths(fields, schema) {
continue;
}
field = fields[keys[ki]];
if (typeof field === 'object' && field && field.$slice) {
// Skip `$meta` and `$slice`
if (!isDefiningProjection(field)) {
continue;
}
exclude = field === 0;
Expand Down

0 comments on commit 107b838

Please sign in to comment.