add iterator check for mongo
This commit is contained in:
parent
ff148f58f8
commit
6d22037602
1 changed files with 6 additions and 4 deletions
|
|
@ -141,9 +141,8 @@ func (it *Iterator) Clone() graph.Iterator {
|
||||||
func (it *Iterator) Next() bool {
|
func (it *Iterator) Next() bool {
|
||||||
var result struct {
|
var result struct {
|
||||||
Id string "_id"
|
Id string "_id"
|
||||||
//Sub string "Sub"
|
Added []int64
|
||||||
//Pred string "Pred"
|
Deleted []int64
|
||||||
//Obj string "Obj"
|
|
||||||
}
|
}
|
||||||
found := it.iter.Next(&result)
|
found := it.iter.Next(&result)
|
||||||
if !found {
|
if !found {
|
||||||
|
|
@ -153,6 +152,9 @@ func (it *Iterator) Next() bool {
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if it.collection == "quads" && len(result.Added) <= len(result.Deleted) {
|
||||||
|
return it.Next()
|
||||||
|
}
|
||||||
it.result = result.Id
|
it.result = result.Id
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue