|
|
@ -36,7 +36,7 @@ func (store *MongodbStore) KvGet(ctx context.Context, key []byte) (value []byte, |
|
|
|
var where = bson.M{"directory": dir, "name": name} |
|
|
|
err = store.connect.Database(store.database).Collection(store.collectionName).FindOne(ctx, where).Decode(&data) |
|
|
|
if err != mongo.ErrNoDocuments && err != nil { |
|
|
|
glog.Error("kv get: %v", err) |
|
|
|
glog.Errorf("kv get: %v", err) |
|
|
|
return nil, filer.ErrKvNotFound |
|
|
|
} |
|
|
|
|
|
|
@ -54,7 +54,7 @@ func (store *MongodbStore) KvDelete(ctx context.Context, key []byte) (err error) |
|
|
|
where := bson.M{"directory": dir, "name": name} |
|
|
|
_, err = store.connect.Database(store.database).Collection(store.collectionName).DeleteOne(ctx, where) |
|
|
|
if err != nil { |
|
|
|
return fmt.Errorf("kv delete %s : %v", err) |
|
|
|
return fmt.Errorf("kv delete: %v", err) |
|
|
|
} |
|
|
|
|
|
|
|
return nil |
|
|
|