import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"../../funcs"
)
// id从1开始递增
func GenId(db *mgo.Database) (int64, error) {
IDInt64 := struct {
Value int64 `bson:"max_id"`
}{Value: 1}
_, err := db.C("gen_id").Find(bson.M{}).Apply(mgo.Change{Update: bson.M{"$inc": IDInt64}, Upsert: true, ReturnNew: true}, &IDInt64)
return IDInt64.Value, err
}
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款