Documentation ¶
Index ¶
- Variables
- func CheckMongoSessionLost()
- func Count(collection *mgo.Collection, q interface{}) int
- func Delete(collection *mgo.Collection, q interface{}) bool
- func DeleteAll(collection *mgo.Collection, q interface{}) bool
- func DeleteAllByIdAndUserId(collection *mgo.Collection, id, userId string) bool
- func DeleteAllByIdAndUserId2(collection *mgo.Collection, id, userId bson.ObjectId) bool
- func DeleteByIdAndUserId(collection *mgo.Collection, id, userId string) bool
- func DeleteByIdAndUserId2(collection *mgo.Collection, id, userId bson.ObjectId) bool
- func DeleteOneHistory(collection *mgo.Collection, id, userId string, timeToDel time.Time) bool
- func Distinct(collection *mgo.Collection, q bson.M, field string, i interface{})
- func Err(err error) bool
- func Get(collection *mgo.Collection, id string, i interface{})
- func Get2(collection *mgo.Collection, id bson.ObjectId, i interface{})
- func GetByIdAndUserId(collection *mgo.Collection, id, userId string, i interface{})
- func GetByIdAndUserId2(collection *mgo.Collection, id, userId bson.ObjectId, i interface{})
- func GetByQ(collection *mgo.Collection, q interface{}, i interface{})
- func GetByQWithFields(collection *mgo.Collection, q bson.M, fields []string, i interface{})
- func GetIdAndUserIdBsonQ(id, userId bson.ObjectId) bson.M
- func GetIdAndUserIdQ(id, userId string) bson.M
- func GetLastOneInArray(collection *mgo.Collection, id, userId, field string, i interface{})
- func GetNoteHistoriesCount(collection *mgo.Collection, noteId, userId string) int
- func Has(collection *mgo.Collection, q interface{}) bool
- func Init(url, dbname string)
- func Insert(collection *mgo.Collection, i interface{}) bool
- func ListByQ(collection *mgo.Collection, q interface{}, i interface{})
- func ListByQLimit(collection *mgo.Collection, q interface{}, i interface{}, limit int)
- func ListByQWithFields(collection *mgo.Collection, q bson.M, fields []string, i interface{})
- func Update(collection *mgo.Collection, query interface{}, i interface{}) bool
- func UpdateAll(collection *mgo.Collection, query interface{}, i interface{}) bool
- func UpdateByIdAndUserId(collection *mgo.Collection, id, userId string, i interface{}) bool
- func UpdateByIdAndUserId2(collection *mgo.Collection, id, userId bson.ObjectId, i interface{}) bool
- func UpdateByIdAndUserIdField(collection *mgo.Collection, id, userId, field string, value interface{}) bool
- func UpdateByIdAndUserIdField2(collection *mgo.Collection, id, userId bson.ObjectId, field string, ...) bool
- func UpdateByIdAndUserIdMap(collection *mgo.Collection, id, userId string, v bson.M) bool
- func UpdateByIdAndUserIdMap2(collection *mgo.Collection, id, userId bson.ObjectId, v bson.M) bool
- func UpdateByIdAndUserIdPop(collection *mgo.Collection, id, userId, field string, frontBack int) bool
- func UpdateByIdAndUserIdPush(collection *mgo.Collection, id, userId, field string, value interface{}) bool
- func UpdateByQField(collection *mgo.Collection, q interface{}, field string, value interface{}) bool
- func UpdateByQI(collection *mgo.Collection, q interface{}, v interface{}) bool
- func UpdateByQMap(collection *mgo.Collection, q interface{}, v interface{}) bool
- func UpdateHistoryBackupState(collection *mgo.Collection, id, userId string, isAutoBackup bool) bool
- func Upsert(collection *mgo.Collection, query interface{}, i interface{}) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var Albums *mgo.Collection
Album & file(image)
View Source
var Attachs *mgo.Collection
View Source
var BlogComments *mgo.Collection
View Source
var BlogLikes *mgo.Collection
blog
View Source
var BlogSingles *mgo.Collection
View Source
var Blogs *mgo.Collection
View Source
var Configs *mgo.Collection
View Source
var EmailLogs *mgo.Collection
View Source
var Files *mgo.Collection
View Source
var GroupUsers *mgo.Collection
View Source
var Groups *mgo.Collection
View Source
var NoteContentHistories *mgo.Collection
View Source
var NoteContents *mgo.Collection
View Source
var NoteImages *mgo.Collection
View Source
var NoteTags *mgo.Collection
View Source
var Notebooks *mgo.Collection
各个表的Collection对象
View Source
var Notes *mgo.Collection
View Source
var Reports *mgo.Collection
View Source
var Session *mgo.Session
数据连接
View Source
var Sessions *mgo.Collection
session
View Source
var Suggestions *mgo.Collection
View Source
var TagCounts *mgo.Collection
View Source
var Tags *mgo.Collection
View Source
var Themes *mgo.Collection
View Source
var Tokens *mgo.Collection
View Source
var UserBlogs *mgo.Collection
View Source
var Users *mgo.Collection
Functions ¶
func DeleteAllByIdAndUserId ¶
删除所有
func DeleteAllByIdAndUserId2 ¶
func DeleteByIdAndUserId ¶
func DeleteByIdAndUserId2 ¶
func DeleteOneHistory ¶
func GetByIdAndUserId ¶
func GetByIdAndUserId(collection *mgo.Collection, id, userId string, i interface{})
func GetByIdAndUserId2 ¶
func GetByQWithFields ¶
查询某些字段, q是查询条件, fields是字段名列表
func GetLastOneInArray ¶
func GetLastOneInArray(collection *mgo.Collection, id, userId, field string, i interface{})
func GetNoteHistoriesCount ¶
func ListByQLimit ¶
func ListByQLimit(collection *mgo.Collection, q interface{}, i interface{}, limit int)
func ListByQWithFields ¶
查询某些字段, q是查询条件, fields是字段名列表
func Update ¶
func Update(collection *mgo.Collection, query interface{}, i interface{}) bool
适合一条记录全部更新
func UpdateByIdAndUserId ¶
func UpdateByIdAndUserId2 ¶
func UpdateByIdAndUserIdMap ¶
func UpdateByIdAndUserIdMap2 ¶
func UpdateByIdAndUserIdPop ¶
func UpdateByIdAndUserIdPush ¶
func UpdateByQField ¶
func UpdateByQI ¶
func UpdateByQI(collection *mgo.Collection, q interface{}, v interface{}) bool
func UpdateByQMap ¶
func UpdateByQMap(collection *mgo.Collection, q interface{}, v interface{}) bool
查询条件和值
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.