

def where(self, code):
    'Adds a $where clause to this query.\n\n        The `code` argument must be an instance of :class:`basestring`\n        (:class:`str` in python 3) or :class:`~bson.code.Code`\n        containing a JavaScript expression. This expression will be\n        evaluated for each document scanned. Only those documents\n        for which the expression evaluates to *true* will be returned\n        as results. The keyword *this* refers to the object currently\n        being scanned.\n\n        Raises :class:`TypeError` if `code` is not an instance of\n        :class:`basestring` (:class:`str` in python 3). Raises\n        :class:`~pymongo.errors.InvalidOperation` if this\n        :class:`Cursor` has already been used. Only the last call to\n        :meth:`where` applied to a :class:`Cursor` has any effect.\n\n        :Parameters:\n          - `code`: JavaScript expression to use as a filter\n        '
    self.__check_okay_to_chain()
    if (not isinstance(code, Code)):
        code = Code(code)
    self.__spec['$where'] = code
    return self

dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py Cursor.where/original