Documentation ¶
Index ¶
- Constants
- func MongoConnection(db *MongoDB) (*mongo.Client, *mongo.Collection)
- func MongoDisconnect(client *mongo.Client)
- type MongoDB
- func (db *MongoDB) FindPersonByID(ctx context.Context, accountId string) ([]byte, error)
- func (db *MongoDB) FindPersonByPhone(ctx context.Context, phone string) ([]byte, error)
- func (db *MongoDB) FindPersonCrendential(ctx context.Context, _id string) ([]byte, error)
- func (db *MongoDB) FindPersonProfile(ctx context.Context, _id string) ([]byte, error)
- func (db *MongoDB) Save(ctx context.Context, person any) (*mongo.InsertOneResult, error)
- func (db *MongoDB) Update(ctx context.Context, _id string, person any) (*mongo.UpdateResult, error)
Constants ¶
View Source
const (
COLLECTION = "person"
)
Variables ¶
This section is empty.
Functions ¶
func MongoConnection ¶
func MongoConnection(db *MongoDB) (*mongo.Client, *mongo.Collection)
func MongoDisconnect ¶
Types ¶
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
func NewMongoDB ¶
func NewMongoDB(config *person_config.Config) *MongoDB
func (*MongoDB) FindPersonByID ¶
func (*MongoDB) FindPersonByPhone ¶
func (*MongoDB) FindPersonCrendential ¶
func (*MongoDB) FindPersonProfile ¶
Click to show internal directories.
Click to hide internal directories.