GetOne should use id
This commit is contained in:
@@ -44,7 +44,7 @@ func BuildGetOne(col map[string]any, report *InitReport) {
|
||||
mc := mongo.GetMongoClient()
|
||||
|
||||
// we defer function's implementation until we create the actual struct
|
||||
deferedFuncs[funcName] = func(ctx context.Context, data map[string]any) (bson.M, error) {
|
||||
deferedFuncs[funcName] = func(ctx context.Context, id string) (bson.M, error) {
|
||||
db := "__undefined__"
|
||||
if isSystem {
|
||||
db = sysDb
|
||||
@@ -55,6 +55,6 @@ func BuildGetOne(col map[string]any, report *InitReport) {
|
||||
}
|
||||
}
|
||||
|
||||
return mc.GetOne(ctx, db, name, data)
|
||||
return mc.GetOne(ctx, db, name, id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user