|
@ -109,6 +109,10 @@ func (store *MongodbStore) InsertEntry(ctx context.Context, entry *filer.Entry) |
|
|
Meta: meta, |
|
|
Meta: meta, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return fmt.Errorf("InsertEntry %st: %v", entry.FullPath, err) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -124,6 +128,7 @@ func (store *MongodbStore) FindEntry(ctx context.Context, fullpath util.FullPath |
|
|
var where = bson.M{"directory": dir, "name": name} |
|
|
var where = bson.M{"directory": dir, "name": name} |
|
|
err = store.connect.Database(store.database).Collection(store.collectionName).FindOne(ctx, where).Decode(&data) |
|
|
err = store.connect.Database(store.database).Collection(store.collectionName).FindOne(ctx, where).Decode(&data) |
|
|
if err != mongo.ErrNoDocuments && err != nil { |
|
|
if err != mongo.ErrNoDocuments && err != nil { |
|
|
|
|
|
glog.Error("find %s: %v", fullpath, err) |
|
|
return nil, filer_pb.ErrNotFound |
|
|
return nil, filer_pb.ErrNotFound |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|