Skip to content

Commit

Permalink
fix(query): use projection instead of fields for find(), `findO…
Browse files Browse the repository at this point in the history
…ne()`, `cursor()`, etc.

Re: #6880
  • Loading branch information
vkarpov15 committed Aug 22, 2018
1 parent 3b57acc commit d1e4981
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/query.js
Expand Up @@ -85,6 +85,11 @@ function Query(conditions, options, model, collection) {
}

this.options = this.options || {};

// For gh-6880. mquery still needs to support `fields` by default for old
// versions of MongoDB
this.options.useProjection = true;

const collation = get(this, 'schema.options.collation', null);
if (collation != null) {
this.options.collation = collation;
Expand Down

0 comments on commit d1e4981

Please sign in to comment.