MCPcopy
hub / github.com/Pradumnasaraf/DevOps / deleteOneMovie

Function deleteOneMovie

docs/golang/apps/mongo-api/controller/controller.go:58–65  ·  view source on GitHub ↗
(movieId string)

Source from the content-addressed store, hash-verified

56}
57
58func deleteOneMovie(movieId string) {
59 id, _ := primitive.ObjectIDFromHex(movieId)
60 filter := bson.M{"_id": id}
61 result, err := collection.DeleteOne(context.Background(), filter)
62
63 checkNilErr(err)
64 fmt.Println("Modified count:", result.DeletedCount)
65}
66
67func deleteAllMovies() int64 {
68 filter := bson.D{{}}

Callers 1

DeleteAMovieFunction · 0.85

Calls 1

checkNilErrFunction · 0.70

Tested by

no test coverage detected