Handle both bson.D and bson.M on Find results

This commit is contained in:
George Suntres
2026-04-20 13:08:13 -04:00
parent 29144f54bd
commit 1547f8c736
4 changed files with 24 additions and 11 deletions

View File

@@ -4,8 +4,6 @@ import (
"context"
"log"
// "runtime"
"go.mongodb.org/mongo-driver/v2/mongo"
"go.mongodb.org/mongo-driver/v2/mongo/options"
"go.mongodb.org/mongo-driver/v2/bson"
@@ -19,8 +17,6 @@ func (c *MongoClient) CreateViews(db *mongo.Database, cdef *CollectionDefinition
return
}
// runtime.Breakpoint()
for name, defVal := range cdef.Views {
// 1. Decode definition