From 73f215f0ba10da86b5661fcabbe250e30d39c747 Mon Sep 17 00:00:00 2001 From: Derrick Mehaffy Date: Fri, 29 Mar 2019 06:58:32 -0700 Subject: [PATCH] PR Feedback fixes --- docs/3.x.x/guides/filters.md | 6 +++--- packages/strapi-hook-mongoose/lib/utils/index.js | 2 +- packages/strapi-plugin-graphql/services/Aggregator.js | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/3.x.x/guides/filters.md b/docs/3.x.x/guides/filters.md index 763253055e..10d54f5675 100644 --- a/docs/3.x.x/guides/filters.md +++ b/docs/3.x.x/guides/filters.md @@ -50,13 +50,13 @@ or ##### Or clauses -If you use the same operator (except for in and nin) the values will be use to build and `OR` query +If you use the same operator (except for in and nin) the values will be use to build an `OR` query `GET /posts?title_contains=article&title_contains=truc` ### Deep filtering -Find posts written by a user who belongs to a company with the name equal to strapi +Find posts written by a user who belongs to a company with the name equal to Strapi `GET /posts?author.company.name=strapi` ::: note @@ -180,7 +180,7 @@ If you are using a mongo database calling `buildQuery` returns either a [`Mongoo ##### Custom Query When using the deep filtering feature with mongo, we build an aggregation query to avoid too many round-trips with the mongo DB. -Doing that means we don't get a Mongoose object andin return bu a plain JS Object. This brings a lot of issues like no virtual fields available and not Mongoose lifecycles etc. +Doing that means we don't get a Mongoose object and instead it returns a plain JS Object. This brings a lot of issues like no virtual fields available and not Mongoose life cycles etc. To give the best experience possible, we decided to rehydrate the Mongoose models, forcing us to override the Mongoose query diff --git a/packages/strapi-hook-mongoose/lib/utils/index.js b/packages/strapi-hook-mongoose/lib/utils/index.js index 948c75ea49..d38bcc9dc5 100644 --- a/packages/strapi-hook-mongoose/lib/utils/index.js +++ b/packages/strapi-hook-mongoose/lib/utils/index.js @@ -71,7 +71,7 @@ module.exports = (mongoose = Mongoose) => { } // Here we don't use mongoose.Types.ObjectId.isValid method because it's a weird check, - // it returns for instance true for any integer value ¯\_(ツ)_/¯ + // it returns for instance true for any integer value const hexadecimal = /^[0-9A-F]+$/i; return hexadecimal.test(value) && value.length === 24; }, diff --git a/packages/strapi-plugin-graphql/services/Aggregator.js b/packages/strapi-plugin-graphql/services/Aggregator.js index 1e5e825457..1a029ba976 100644 --- a/packages/strapi-plugin-graphql/services/Aggregator.js +++ b/packages/strapi-plugin-graphql/services/Aggregator.js @@ -1,3 +1,5 @@ +'use strict'; + /** * Aggregator.js service *