Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
rwynn committed Oct 25, 2019
1 parent d7134e6 commit 8c0a03c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gtm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8c0a03c

Please sign in to comment.