func InsertManyValues(people []models.Person) {
	var ppl []interface{}
	for _, p := range people {
		ppl = append(ppl, p)
	}
	_, err := db.Collection(COLLNAME).InsertMany(context.Background(), ppl)
	if err != nil {
		log.Fatal(err)
	}
}
InsertManyValues inserts many items from byte slice
package dao
import (
	"context"
	"fmt"
	"log"
	"phonebook-backend/models"
	"github.com/mongodb/mongo-go-driver/bson"
	"github.com/mongodb/mongo-go-driver/mongo"
)
const CONNECTIONSTRING = "mongodb://localhost:27017"
const DBNAME = "phonebook"
const COLLNAME = "people"
var db *mongo.Database
func init() {
	client, err := mongo.NewClient(CONNECTIONSTRING)
	if err != nil {
		log.Fatal(err)
	}
	err = client.Connect(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	db = client.Database(DBNAME)
}