fixes #13, invalid object keyword, panic on missing key

This commit is contained in:
Josh Baker 2016-04-19 05:38:02 -07:00
parent b211d9fe15
commit cd217f05d2
2 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -e
VERSION="1.1.3"
VERSION="1.1.4"
PROTECTED_MODE="no"
# Hardcode some values to the core package

View File

@ -215,7 +215,7 @@ func (c *Controller) cmdSearchArgs(cmd string, vs []resp.Value, types []string)
}
var nearbyTypes = []string{"point"}
var withinOrIntersectsTypes = []string{"geo", "bounds", "hash", "tile", "quadkey", "get"}
var withinOrIntersectsTypes = []string{"geo", "bounds", "hash", "tile", "quadkey", "get", "object"}
func (c *Controller) cmdNearby(msg *server.Message) (res string, err error) {
start := time.Now()
@ -274,6 +274,9 @@ func (c *Controller) cmdWithinOrIntersects(cmd string, msg *server.Message) (res
if err != nil {
return "", err
}
if sw.col == nil {
return "", errKeyNotFound
}
wr.WriteString(`{"ok":true`)
sw.writeHead()
if cmd == "within" {