INNER CODE UNIT · Go
func
rwynn/gtm · gtm.go:230
func (cs *CollectionSegment) shrinkTo(next interface{}) {
cs.max = next
}
func (cs *CollectionSegment) toSelector() bson.M {
sel, doc := bson.M{}, bson.M{}
if cs.min != nil {
doc["$gte"] = cs.min
}
if cs.max != nil {
if cs.maxIncl {
doc["$lte"] = cs.max
} else {
doc["$lt"] = cs.max
}
}
if len(doc) > 0 {
sel[cs.splitKey] = doc