lib/db/mongodb/mixins/fields.js
function(options){
            var cleanOptions = this.parseOptions(options),
                excludes = _.clone(this.privateFields),
                includeExludes = [];

            // If any includes are passed in through the options clean up the
            // default excluded fields. A type can have some excluded fields by
            // default and if the user overrides this then we need to clean up the query.
            if(options && options.include){
                _.each(options.include, function(include){
                    //If the include matches an existing exclude then remove it from the
                    //excludes and also from the includes (you can't mix them)
                    excludes = _.remove(excludes, function(o){
                        if(o === include){
                            cleanOptions.include = _.remove(cleanOptions.include, function(i){
                                return i !== include;
                            });
                        }

                        return o !== include;
                    });

                });
            }

            includeExludes = _.union(cleanOptions.include,
                this.parseExclusion(cleanOptions.exclude),
                this.parseExclusion(excludes)
            );

            return includeExludes.join(' ');
        }
function(options){
            var cleanOptions = this.parseOptions(options),
                excludes = _.clone(this.privateFields),
                includeExludes = [];

            // If any includes are passed in through the options clean up the
            // default excluded fields. A type can have some excluded fields by
            // default and if the user overrides this then we need to clean up the query.
            if(options && options.include){
                _.each(options.include, function(include){
                    //If the include matches an existing exclude then remove it from the
                    //excludes and also from the includes (you can't mix them)
                    excludes = _.remove(excludes, function(o){
                        if(o === include){
                            cleanOptions.include = _.remove(cleanOptions.include, function(i){
                                return i !== include;
                            });
                        }

                        return o !== include;
                    });

                });
            }

            includeExludes = _.union(cleanOptions.include,
                this.parseExclusion(cleanOptions.exclude),
                this.parseExclusion(excludes)
            );

            return includeExludes.join(' ');
        }
function ( options ) { var cleanOptions = this . parseOptions ( options ) , excludes = _ . clone ( this . privateFields ) , includeExludes = [ ] ; // If any includes are passed in through the options clean up the // default excluded fields. A type can have some excluded fields by // default and if the user overrides this then we need to clean up the query. if ( options && options . include ) { _ . each ( options . include , function ( include ) { //If the include matches an existing exclude then remove it from the //excludes and also from the includes (you can't mix them) excludes = _ . remove ( excludes , function ( o ) { if ( o === include ) { cleanOptions . include = _ . remove ( cleanOptions . include , function ( i ) { return i !== include ; } ) ; } return o !== include ; } ) ; } ) ; } includeExludes = _ . union ( cleanOptions . include , this . parseExclusion ( cleanOptions . exclude ) , this . parseExclusion ( excludes ) ) ; return includeExludes . join ( ' ' ) ; }
Build string variable that can be sent to mongo query to include or exclude fields in the response. Your
implementation module should set 'privateFields' so that we can use the parameter here.

@param options Query options object
@returns {string}
Build string variable that can be sent to mongo query to include or exclude fields in the response . Your implementation module should set privateFields so that we can use the parameter here .