From 6704ead11578cdabbf10149dd4babd09e92b5dec Mon Sep 17 00:00:00 2001 From: 0ceanSlim Date: Thu, 22 Aug 2024 12:59:53 -0400 Subject: [PATCH] change 'createdat' to created_at --- server/handlers/req.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/handlers/req.go b/server/handlers/req.go index e2f4188..beb9d7b 100644 --- a/server/handlers/req.go +++ b/server/handlers/req.go @@ -130,17 +130,17 @@ func QueryEvents(filters []relay.Filter, client *mongo.Client, databaseName stri } } if filter.Since != nil { - filterBson["createdat"] = bson.M{"$gte": *filter.Since} + filterBson["created_at"] = bson.M{"$gte": *filter.Since} } if filter.Until != nil { - if filterBson["createdat"] == nil { - filterBson["createdat"] = bson.M{"$lte": *filter.Until} + if filterBson["created_at"] == nil { + filterBson["created_at"] = bson.M{"$lte": *filter.Until} } else { - filterBson["createdat"].(bson.M)["$lte"] = *filter.Until + filterBson["created_at"].(bson.M)["$lte"] = *filter.Until } } - opts := options.Find().SetSort(bson.D{{Key: "createdat", Value: -1}}) + opts := options.Find().SetSort(bson.D{{Key: "created_at", Value: -1}}) if filter.Limit != nil { opts.SetLimit(int64(*filter.Limit)) }