Documentation ¶
Index ¶
Constants ¶
View Source
const ( Mongo_Stage_Lookup = "$lookup" Mongo_Stage_Group = "$group" Mongo_Stage_Replace_Root = "$replaceRoot" Mongo_Stage_Unwind = "$unwind" Mongo_Stage_Macth = "$match" Mongo_Stage_Sort = "$sort" Mongo_Stage_Skip = "$skip" Mongo_Stage_Limit = "$limit" Mongo_Stage_AddFields = "$addFields" Mongo_Operator_Gte = "$gte" Mongo_Operator_Gt = "$gt" Mongo_Operator_Lte = "$lte" Mongo_Operator_Lt = "$lt" Mongo_Operator_Eq = "$eq" Mongo_Operator_Ne = "$ne" Mongo_Operator_And = "$and" Mongo_Operator_Or = "$or" Mongo_Operator_In = "$in" Mongo_Operator_Not = "$not" Mongo_Operator_Expr = "$expr" Mongo_Operator_Regex = "$regex" Mongo_Operator_Sum = "$sum" Mongo_Operator_Cond = "$cond" Mongo_Operator_IfNull = "$ifNull" Mongo_Operator_Avg = "$avg" Mongo_Operator_AddToSet = "$addToSet" Mongo_Operator_Size = "$size" Mongo_Operator_Year = "$year" Mongo_Operator_Month = "$month" Mongo_Operator_DayOfMonth = "$dayOfMonth" Mongo_Operator_Hour = "$hour" Mongo_Operator_Minute = "$minute" Mongo_Operator_Second = "$second" Mongo_Operator_DateToString = "$dateToString" Mongo_Operator_Add = "$add" Mongo_Operator_Subtract = "$subtract" Mongo_Operator_Multiply = "$multiply" Mongo_Operator_Divide = "$divide" Mongo_Operator_Round = "$round" Mongo_Operator_Switch = "$switch" Mongo_Operator_Type = "$type" Mongo_Operator_Now = "$$NOW" Mongo_Operator_To_Double = "$toDouble" Mongo_Operator_Floor = "$floor" Mongo_Operator_Push = "$push" Mongo_Operator_ArrayElemAt = "$arrayElemAt" Mongo_Operator_Split = "$split" Mongo_Operator_Date_Trunc = "$dateTrunc" Mongo_Arg_If = "if" Mongo_Arg_Then = "then" Mongo_Arg_Else = "else" Mongo_Arg_Let = "let" Mongo_Arg_Pipeline = "pipeline" Mongo_Arg_Branches = "branches" Mongo_Arg_Case = "case" Mongo_Arg_Default = "default" Mongo_Arg_Missing = "missing" Mongo_Arg_Date = "date" Mongo_Arg_Unit = "unit" )
Variables ¶
View Source
var ( Mongo_Binary_Operator_Mapping = map[opcode.Op]string{ opcode.Plus: Mongo_Operator_Add, opcode.Minus: Mongo_Operator_Subtract, opcode.Mul: Mongo_Operator_Multiply, opcode.Div: Mongo_Operator_Divide, opcode.GE: Mongo_Operator_Gte, opcode.GT: Mongo_Operator_Gt, opcode.LE: Mongo_Operator_Lte, opcode.LT: Mongo_Operator_Lt, opcode.EQ: Mongo_Operator_Eq, opcode.NE: Mongo_Operator_Ne, opcode.Like: Mongo_Operator_Regex, } )
Functions ¶
Types ¶
type ConverterValidator ¶
type MongoPipeline ¶
type MongoQuery ¶
type MongoQuery struct { Sql parser.SQL // 最终查询字段 SelectFields []*parser.Column // 聚合起始view StartView string // 最终生成的view Pipeline bson.A }
func (MongoQuery) OriginalSQL ¶
func (query MongoQuery) OriginalSQL() parser.SQL
type MongoQueryConverter ¶
type MongoQueryConverter struct {
// contains filtered or unexported fields
}
mongo查询语句转化器
type SelectConverter ¶
func NewMongoQueryConverter ¶
func NewMongoQueryConverter(sql parser.SQL, sourceView map[string]string) SelectConverter
Click to show internal directories.
Click to hide internal directories.