agent SDK fix
This commit is contained in:
@@ -573,13 +573,13 @@ func (w *NoticeWorker) getNextSequentialNumber(ctx context.Context, sourceCode,
|
||||
|
||||
// Create aggregation pipeline to find the highest sequential number
|
||||
pipeline := mongodriver.Pipeline{
|
||||
bson.D{{"$match", bson.M{
|
||||
bson.D{{Key: "$match", Value: bson.M{
|
||||
"tender_id": bson.M{"$regex": pattern},
|
||||
}}},
|
||||
bson.D{{"$project", bson.M{
|
||||
bson.D{{Key: "$project", Value: bson.M{
|
||||
"sequential_num": bson.M{"$substr": bson.A{"$tender_id", 5, 3}}, // Extract last 3 chars (NNN)
|
||||
}}},
|
||||
bson.D{{"$group", bson.M{
|
||||
bson.D{{Key: "$group", Value: bson.M{
|
||||
"_id": nil,
|
||||
"max_num": bson.M{"$max": bson.M{"$toInt": "$sequential_num"}},
|
||||
}}},
|
||||
|
||||
Reference in New Issue
Block a user