mongo

package
v0.0.0-...-c20c62a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, student Student) (deleted int64, err error)

func Init

func Init()

func Insert

func Insert(ctx context.Context, student Student) (err error)

func Main

func Main()

func ReplaceOne

func ReplaceOne(ctx context.Context, student Student) (modified int64, err error)

ReplaceOne 未命中不报错, modified = 0

func Update

func Update(ctx context.Context, student Student) (modified int64, err error)

Types

type Student

type Student struct {
	Id      int64  `bson:"id"`
	ClassId int64  `bson:"score,omitempty"`
	Name    string `bson:"name,omitempty"`
}

func FindByFilter

func FindByFilter(ctx context.Context, filter map[string]interface{}) (students []Student, err error)

FindByFilter 根据条件查找记录 注 : filter 需要大于 0 未命中不报错, len(userComments) = 0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL