From a6ef194be907c207cfa480ed33c570bd115b9719 Mon Sep 17 00:00:00 2001 From: Nicola Iarocci Date: Fri, 3 Aug 2018 15:17:01 +0200 Subject: [PATCH] Fix: OperationFailure on Mongo full text searches Closes #1176 --- CHANGES.rst | 2 ++ eve/io/base.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 3977592b3..6a67387d8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,7 @@ Unreleased Fixed ~~~~~ +- v0.8: ``OperationFailure`` performing MongoDB full text searches (`#1176`_) - ``AttributeError`` on Python 2.7 when obsolete ``JSON`` or ``XML`` settings are used (`#1175`_). - ``TypeError argument of type 'NoneType' is not iterable`` error when using document embedding in conjuction with soft deletes (`#1120`_) - ``allow_unknown`` validation rule fails with nested dict fields (`#1163`_) @@ -40,6 +41,7 @@ Docs - Add a ``ISSUE_TEMPLATE.md`` GitHub template file. (`#1146`_) - Improve changelog format to reduce noise and increase readability. (`#1143`_) +.. _`#1176`: https://github.com/pyeve/eve/issues/1176 .. _`#1175`: https://github.com/pyeve/eve/issues/1175 .. _`#1142`: https://github.com/pyeve/eve/issues/1142 .. _`#1143`: https://github.com/pyeve/eve/issues/1143 diff --git a/eve/io/base.py b/eve/io/base.py index 3b01adade..650b5fc65 100644 --- a/eve/io/base.py +++ b/eve/io/base.py @@ -464,7 +464,7 @@ def _datasource_ex( fields = client_projection # always drop exclusion projection, thus avoid mixed projection not # supported by db driver - fields = dict([(field, 1) for field, value in fields.items() if value]) + fields = dict([(field, value) for field, value in fields.items() if value]) # If the current HTTP method is in `public_methods` or # `public_item_methods`, skip the `auth_field` check