From 8c0a03c52cb579189784a014f1e9d425a5a3b3e6 Mon Sep 17 00:00:00 2001 From: Ryan Wynn Date: Fri, 25 Oct 2019 04:44:02 +0000 Subject: [PATCH] fix query --- gtm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtm.go b/gtm.go index 3475c15..e1bc040 100644 --- a/gtm.go +++ b/gtm.go @@ -273,7 +273,7 @@ func (cs *CollectionSegment) setMin(ctx context.Context, c *mongo.Collection) (e opts.SetSort(bson.M{cs.splitKey: 1}) opts.SetProjection(bson.M{cs.splitKey: 1}) doc := make(map[string]interface{}) - if err = c.FindOne(ctx, nil, opts).Decode(&doc); err == nil { + if err = c.FindOne(ctx, bson.M{}, opts).Decode(&doc); err == nil { cs.min = doc[cs.splitKey] } return @@ -284,7 +284,7 @@ func (cs *CollectionSegment) setMax(ctx context.Context, c *mongo.Collection) (e opts.SetSort(bson.M{cs.splitKey: -1}) opts.SetProjection(bson.M{cs.splitKey: 1}) doc := make(map[string]interface{}) - if err = c.FindOne(ctx, nil, opts).Decode(&doc); err == nil { + if err = c.FindOne(ctx, bson.M{}, opts).Decode(&doc); err == nil { cs.max = doc[cs.splitKey] } return