Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 62d3c86f8f
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (23 sloc) 0.603 kB
package mongo
import (
"github.com/ungerik/go-start/mgo/bson"
)
///////////////////////////////////////////////////////////////////////////////
// filterStartsWithQuery
type filterStartsWithQuery struct {
filterQueryBase
selector string
str string
caseInsensitive bool
}
func (self *filterStartsWithQuery) bsonSelector() bson.M {
s := escapeStringForRegex(self.str)
var options string
if self.caseInsensitive {
options = "i"
}
return bson.M{self.selector: bson.RegEx{"^" + s, options}}
}
func (self *filterStartsWithQuery) Selector() string {
return self.selector
}
Jump to Line
Something went wrong with that request. Please try again.