Skip to content

Commit 197b162

Browse files
committed
Wiki
1 parent 1cb1f06 commit 197b162

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.rst

+8-4
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ Getting [one] node:
5858

5959
>>> g.get_node(f)
6060
{u'_id': ObjectId('4dd49c6f2041095cbc000000'), u'name': u'f'}
61+
>>>
6162
>>> g.get_node(s)
6263
{u'_id': ObjectId('4dd49c832041095cbc000003'), u'name': u's'}
64+
>>>
65+
>>> g.get_node(xxx)
66+
{u'cities': [u'Sao Paulo', u'Rio de Janeiro'], u'name': u'xxx', u'country': u'BR', u'phone': {u'mobile': u'+551112345678'}, u'_id': ObjectId('4dd4a1982041095cbc000008'), u'type': u'P'}
67+
>>>
6368

6469

6570

@@ -94,17 +99,16 @@ Getting edges:
9499
>>> g.get_node_edges(d, direction="out")
95100
{'_id': ObjectId('4dd49c732041095cbc000001'), 'out': {u'4dd49c832041095cbc000003': {u'_to_id': ObjectId('4dd49c832041095cbc000003')}}}
96101
>>>
97-
>>> g.get_node(xxx)
98-
{u'cities': [u'Sao Paulo', u'Rio de Janeiro'], u'name': u'xxx', u'country': u'BR', u'phone': {u'mobile': u'+551112345678'}, u'_id': ObjectId('4dd4a1982041095cbc000008'), u'type': u'P'}
99-
>>>
100-
101102

102103

103104

104105
Traverser:
105106
==========
106107

107108
- Breadth-first search (iterator)
109+
>>>
110+
>>> t = mgraph.Traverser(g)
111+
>>>
108112
>>> [n for n in t.bfs(f)]
109113
[({u'_id': ObjectId('4dd49c6f2041095cbc000000'), u'name': u'f'}, {u'_id': ObjectId('4dd49c782041095cbc000002'), u'name': u'e'}), ({u'_id': ObjectId('4dd49c6f2041095cbc000000'), u'name': u'f'}, {u'_id': ObjectId('4dd49c732041095cbc000001'), u'name': u'd'}), ({u'_id': ObjectId('4dd49c732041095cbc000001'), u'name': u'd'}, {u'_id': ObjectId('4dd49c832041095cbc000003'), u'name': u's'})]
110114

0 commit comments

Comments
 (0)