Expose LabelContext in gremlin

This commit is contained in:
Barak Michener 2015-10-30 17:16:40 -04:00
parent 36d0f48d15
commit 283aca83c2
5 changed files with 28 additions and 4 deletions

View file

@ -274,7 +274,14 @@ func (p *Path) Has(via interface{}, nodes ...string) *Path {
// LabelContext restricts the following operations (such as In, Out) to only
// traverse edges that match the given set of labels.
func (p *Path) LabelContext(via ...interface{}) *Path {
p.stack = append(p.stack, labelContextMorphism(via...))
p.stack = append(p.stack, labelContextMorphism(nil, via...))
return p
}
// LabelContextWithTags is exactly like LabelContext, except it tags the value
// of the label used in the traversal with the tags provided.
func (p *Path) LabelContextWithTags(tags []string, via ...interface{}) *Path {
p.stack = append(p.stack, labelContextMorphism(tags, via...))
return p
}