Skip to content

Commit 4ff2c4f

Browse files
committed
Sorted exadata export
1 parent fba532b commit 4ff2c4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api-service/database/exadata.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ func (md *MongoDatabase) FindAllExadataInstances(hidden bool) ([]model.OracleExa
256256
condition = bson.D{{Key: "hidden", Value: hidden}}
257257
}
258258

259-
pipeline := append(getExadataInstancePipeline, bson.D{{Key: "$match", Value: condition}})
259+
pipeline := append(getExadataInstancePipeline,
260+
bson.D{{Key: "$match", Value: condition}},
261+
bson.D{{Key: "$sort", Value: bson.D{{Key: "hostname", Value: 1}}}})
260262

261263
cur, err := md.Client.Database(md.Config.Mongodb.DBName).Collection(exadataCollection).
262264
Aggregate(ctx, pipeline)

0 commit comments

Comments
 (0)