diff --git a/dev/devcam/server.go b/dev/devcam/server.go index ff79cf867..21108f6d7 100644 --- a/dev/devcam/server.go +++ b/dev/devcam/server.go @@ -276,9 +276,10 @@ func (c *serverCmd) setupIndexer() error { "-dbtype=sqlite", "-dbname="+c.env.m["CAMLI_DBNAME"]) case c.mongo: - // TODO(mpl): hack. add mongo support to dbinit instead. - c.env.Set("CAMLI_MONGO_WIPE", "true") - fallthrough + args = append(args, + "-dbtype=mongo", + "-host=localhost", + "-dbname="+c.env.m["CAMLI_DBNAME"]) default: return nil } diff --git a/pkg/index/mongo/mongoindex.go b/pkg/index/mongo/mongoindex.go index 8102aeb09..e8614e301 100644 --- a/pkg/index/mongo/mongoindex.go +++ b/pkg/index/mongo/mongoindex.go @@ -19,13 +19,9 @@ limitations under the License. package mongo import ( - "os" - "strconv" - "camlistore.org/pkg/blobserver" "camlistore.org/pkg/index" "camlistore.org/pkg/jsonconfig" - "camlistore.org/pkg/sorted" "camlistore.org/pkg/sorted/mongo" ) @@ -40,24 +36,12 @@ func newFromConfig(ld blobserver.Loader, config jsonconfig.Obj) (blobserver.Stor if err != nil { return nil, err } - // TODO(mpl): hack. remove once dbinit supports mongo. - // https://camlistore-review.googlesource.com/1427 - if wipe, _ := strconv.ParseBool(os.Getenv("CAMLI_MONGO_WIPE")); wipe { - wiper, ok := kv.(sorted.Wiper) - if !ok { - panic("mongo KeyValue not a Wiper") - } - err = wiper.Wipe() - if err != nil { - return nil, err - } - } + ix := index.New(kv) sto, err := ld.GetStorage(blobPrefix) if err != nil { return nil, err } - ix.BlobSource = sto // Good enough, for now: