go-pingbot/database/delete.go
Medzik 13771d1394 v1.2.0
- database: added collection to var
- website: changed gin.G to json type
- api: status added cpu usage and move memory to stats
- go: upgrade deps
- update nodemon cfg and README
2021-07-22 08:23:49 +00:00

17 lines
295 B
Go

package database
import (
"context"
"time"
"go.mongodb.org/mongo-driver/mongo"
)
func Delete(url *URL) (*mongo.DeleteResult, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
result, err := Coll.DeleteOne(ctx, url)
return result, err
}