diff --git a/optimade/filtertransformers/mongo.py b/optimade/filtertransformers/mongo.py
index d808ae8f..beba0fcd 100755
--- a/optimade/filtertransformers/mongo.py
+++ b/optimade/filtertransformers/mongo.py
@@ -141,9 +141,9 @@ class MongoTransformer(BaseTransformer):
 
     def constant_first_comparison(self, arg):
         # constant_first_comparison: constant OPERATOR ( non_string_value | not_implemented_string )
-        return {
-            arg[2]: {self.operator_map[self._reversed_operator_map[arg[1]]]: arg[0]}
-        }
+        return self.property_first_comparison(
+            arg[2], {self.operator_map[self._reversed_operator_map[arg[1]]]: arg[0]}
+        )
 
     @v_args(inline=True)
     def value_op_rhs(self, operator, value):

diff --git a/optimade/server/data/test_references.json b/optimade/server/data/test_references.json
index 9dd372ad..05cb7932 100644
--- a/optimade/server/data/test_references.json
+++ b/optimade/server/data/test_references.json
@@ -58,5 +58,25 @@
     "title": "Dummy reference that should remain orphaned from all structures for testing purposes",
     "journal": "JACS",
     "doi": "10.1038/00000"
+  },
+  {
+    "_id": {
+      "$oid": "98fb441f053b1744107019e3"
+    },
+    "id": "dummy/2022",
+    "last_modified": {
+      "$date": "2022-01-23T14:24:37.332Z"
+    },
+    "authors": [
+      {
+        "name": "A Nother",
+        "firstname": "A",
+        "lastname": "Nother"
+      }
+    ],
+    "year": "2019",
+    "note": "Dummy reference",
+    "title": "Just another title",
+    "journal": "JACS"
   }
 ]
diff --git a/tests/filtertransformers/test_mongo.py b/tests/filtertransformers/test_mongo.py
index cf40440e..fec8c2c8 100644
--- a/tests/filtertransformers/test_mongo.py
+++ b/tests/filtertransformers/test_mongo.py
@@ -888,3 +888,8 @@ class TestMongoTransformer:
                 {"number": {"$eq": 0.0}},
             ]
         }
+
+    def test_constant_first_comparisson(self):
+        assert self.transform("nelements != 5") == self.transform("5 != nelements")
+        assert self.transform("nelements > 5") == self.transform("5 < nelements")
+        assert self.transform("nelements <= 5") == self.transform("5 >= nelements")

Queries with the form: 'value != prop' return entries where 'prop == None' 
For the trajectory endpoint, I added a few references without DOI values.
A query like [https://optimade-trajectories.herokuapp.com/v1/references?filter=%2210.1038/00000%22!=doi](https://optimade-trajectories.herokuapp.com/v1/references?filter=%2210.1038/00000%22!=doi) returned 4 entries, while the query 
[https://optimade-trajectories.herokuapp.com/v1/references?filter=doi!=%2210.1038/00000%22](https://optimade-trajectories.herokuapp.com/v1/references?filter=doi!=%2210.1038/00000%22) returns 2 entries

This also applies to other reference properties like journal and year.
tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_constant_first_comparisson
tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_empty tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_property_names tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_provider_property_name tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_nested_property_names tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_string_values tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_number_values tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_simple_comparisons tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_id tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_operators tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_filtering_on_relationships tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_other_provider_fields tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_not_implemented tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_list_length_aliases tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_suspected_timestamp_fields tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_unaliased_length_operator tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_mongo_special_id tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_aliased_length_operator tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_aliases tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_list_properties tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_known_properties tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_precedence tests/filtertransformers/test_mongo.py::TestMongoTransformer::test_special_cases