Skip to content
/ pie Public

pie is a wrapper based on the official mongo-go-driver, all operations are done through chain calls, making it easy to operate MongoDB.

License

Notifications You must be signed in to change notification settings

5xxxx/pie

Alt

pie

pie is a wrapper based on the official mongo-go-driver, all operations are done through chain calls, making it easy to operate MongoDB.

Installation

go get github.com/5xxxx/pie

Connect to database

package main

import (
    "github.com/5xxxx/pie"
    "go.mongodb.org/mongo-driver/mongo/options"
)

client, err := pie.NewClient(cfg.DataBase, options.Client().ApplyURI("mongodb://127.0.0.1:27017"))
if err != nil {
    panic(err)
}

err = t.Connect(context.Background())
if err != nil {
    panic(err)
}

var user User
err = t.filter("nickName", "frank").FindOne(&user)
if err != nil {
    panic(err)
}

fmt.Println(user)

About

pie is a wrapper based on the official mongo-go-driver, all operations are done through chain calls, making it easy to operate MongoDB.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages