Add UpdateSet, Relaxed in client, Fix tests

This commit is contained in:
George Suntres
2026-04-22 10:22:23 -04:00
parent 45f9ac558f
commit 188c5a1be1
9 changed files with 163 additions and 31 deletions

View File

@@ -10,13 +10,15 @@ import (
)
// CreateViews will create views for the given collection and definition.
func (c *MongoClient) CreateViews(db *mongo.Database, cdef *CollectionDefinition) {
func (c *MongoClient) CreateViews(db *mongo.Database, cdef *CollectionDefinition) bool {
if cdef == nil || cdef.Views == nil {
log.Printf("No definition for views found.")
return
return false
}
viewCreated := false
for name, defVal := range cdef.Views {
// 1. Decode definition
@@ -82,6 +84,9 @@ func (c *MongoClient) CreateViews(db *mongo.Database, cdef *CollectionDefinition
continue
}
viewCreated = true
}
return viewCreated
}