refactor field

This commit is contained in:
Josh Baker 2016-07-12 22:51:01 -06:00
parent b08c686c64
commit 4656c4c8f3
3 changed files with 10 additions and 10 deletions

View File

@ -48,7 +48,7 @@ func (c *Controller) cmdScan(msg *server.Message) (res string, err error) {
}
sw.count = uint64(count)
} else {
g := glob.Parse(sw.glob, s.desc)
g := glob.Parse(sw.globPattern, s.desc)
if g.Limits[0] == "" && g.Limits[1] == "" {
s.cursor = sw.col.Scan(s.cursor, stype, s.desc,
func(id string, o geojson.Object, fields []float64) bool {

View File

@ -46,7 +46,7 @@ type scanWriter struct {
once bool
count uint64
precision uint64
glob string
globPattern string
globEverything bool
globSingle bool
fullFields bool
@ -75,12 +75,12 @@ func (c *Controller) newScanWriter(
c: c,
wr: wr,
msg: msg,
output: output,
wheres: wheres,
precision: precision,
nofields: nofields,
glob: globPattern,
limit: limit,
wheres: wheres,
output: output,
nofields: nofields,
precision: precision,
globPattern: globPattern,
matchValues: matchValues,
}
if globPattern == "*" || globPattern == "" {
@ -241,7 +241,7 @@ func (sw *scanWriter) writeObject(id string, o geojson.Object, fields []float64,
keepGoing := true
if !sw.globEverything {
if sw.globSingle {
if sw.glob != id {
if sw.globPattern != id {
return true
}
keepGoing = false // return current object and stop iterating
@ -252,7 +252,7 @@ func (sw *scanWriter) writeObject(id string, o geojson.Object, fields []float64,
} else {
val = id
}
ok, _ := glob.Match(sw.glob, val)
ok, _ := glob.Match(sw.globPattern, val)
if !ok {
return true
}

View File

@ -374,7 +374,7 @@ func (c *Controller) cmdSearch(msg *server.Message) (res string, err error) {
}
sw.count = uint64(count)
} else {
g := glob.Parse(sw.glob, s.desc)
g := glob.Parse(sw.globPattern, s.desc)
if g.Limits[0] == "" && g.Limits[1] == "" {
s.cursor = sw.col.SearchValues(s.cursor, stype, s.desc,
func(id string, o geojson.Object, fields []float64) bool {