docs: def not_query(expression):
      """Apply logical not operator to expression."""
      compiled_expression = compile_query(expression)
  
      def _not(index, expression=compiled_expression):
          """Return store key for documents that satisfy expression."""
          all_keys = index.get_all_keys()
          returned_keys = expression(index)
          return [key for key in all_keys if key not in returned_keys]
  
      return _not