mirror of
https://github.com/vale981/grapher
synced 2025-03-05 09:31:42 -05:00
Merge pull request #145 from Herteby/master
fix issue with adding fields from $filters
This commit is contained in:
commit
9b4ff8ddbc
1 changed files with 5 additions and 2 deletions
|
@ -90,8 +90,11 @@ export default class CollectionNode {
|
|||
_.each(filters, (value, field) => {
|
||||
// special handling for the $meta filter and conditional operators
|
||||
if (!_.contains(['$or', '$nor', '$not', '$and', '$meta'], field)) {
|
||||
hasAddedAnyField = true;
|
||||
options.fields[field] = 1;
|
||||
// if the field or the parent of the field already exists, don't add it
|
||||
if (!_.has(options.fields, field.split('.')[0])){
|
||||
hasAddedAnyField = true;
|
||||
options.fields[field] = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue