def graph_look_up(self, _from, _startWith, _connectFromField, _connectToField,<EOL>_as, _maxDepth=None, _depthField=None, _restrictSearchWithMatch=None):
query = {<EOL>'<STR_LIT>': _from,<EOL>'<STR_LIT>': _startWith,<EOL>'<STR_LIT>': _connectFromField,<EOL>'<STR_LIT>': _connectToField,<EOL>'<STR_LIT>': _as<EOL>}<EOL>if _maxDepth:<EOL><INDENT>query['<STR_LIT>'] = _maxDepth<EOL><DEDENT>if _depthField:<EOL><INDENT>query['<STR_LIT>'] = _depthField<EOL><DEDENT>if _restrictSearchWithMatch:<EOL><INDENT>query['<STR_LIT>'] = _restrictSearchWithMatch<EOL><DEDENT>self._q.append({'<STR_LIT>': query})<EOL>return self<EOL>
Performs a recursive search on a collection, with options for restricting the search by recursion depth and query filter.
:param _from: Target collection for the $graphLookup operation to search, recursively matching the connectFromField to the connectToField.
:param _startWith: Expression that specifies the value of the connectFromField with which to start the recursive search.
:param _connectFromField: Field name whose value $graphLookup uses to recursively match against the connectToField of other documents in the collection.
:param _connectToField: Field name in other documents against which to match the value of the field specified by the connectFromField parameter.
:param _as: Name of the array field added to each output document.
:param _maxDepth: Non-negative integral number specifying the maximum recursion depth.
:param _depthField: Name of the field to add to each traversed document in the search path.
:param _restrictSearchWithMatch: A document specifying additional conditions for the recursive search.
:return: The current object