i have try driver mongodb for a simple connection like on tutorial from this repos github mongo-go-driver i just write client like this :
import (
"fmt"
"github.com/mongodb/mongo-go-driver/mongo"
"github.com/mongodb/mongo-go-driver/mongo/options"
)
var client *mongo.Client
func main() {
fmt.Println("Starting the application...")
client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
if err != nil {
fmt.Println(err.Error())
return
}
}
but show error :
cannot use "github.com/mongodb/mongo-go-driver/mongo/options".Client().ApplyURI("mongodb://localhost:27017") (type *"github.com/mongodb/mongo-go-driver/mongo/options".ClientOptions) as type *"go.mongodb.org/mongo-driver/mongo/options".ClientOptions in argument to mongo.NewClient
Driver version use V1.0.0
Any sugestions ?