diff --git a/generated-usage-examples/go/driver/drop-index.snippet.example.go b/generated-usage-examples/go/atlas-sdk-go/project-copy/drop-index.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/drop-index.snippet.example.go rename to generated-usage-examples/go/atlas-sdk-go/project-copy/drop-index.snippet.example.go diff --git a/generated-usage-examples/go/driver/edit-index.snippet.example.go b/generated-usage-examples/go/atlas-sdk-go/project-copy/edit-index.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/edit-index.snippet.example.go rename to generated-usage-examples/go/atlas-sdk-go/project-copy/edit-index.snippet.example.go diff --git a/generated-usage-examples/go/driver/enn.snippet.example.go b/generated-usage-examples/go/atlas-sdk-go/project-copy/enn.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/enn.snippet.example.go rename to generated-usage-examples/go/atlas-sdk-go/project-copy/enn.snippet.example.go diff --git a/generated-usage-examples/go/atlas-sdk-go/project-copy/test/another-test.txt b/generated-usage-examples/go/atlas-sdk-go/project-copy/test/another-test.txt new file mode 100644 index 0000000..e69de29 diff --git a/generated-usage-examples/go/atlas-sdk-go/project-copy/test/test.txt b/generated-usage-examples/go/atlas-sdk-go/project-copy/test/test.txt new file mode 100644 index 0000000..e69de29 diff --git a/generated-usage-examples/go/driver/ann-basic-with-scenario.snippet.example.go b/generated-usage-examples/go/driver-test/ann-basic-with-scenario.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/ann-basic-with-scenario.snippet.example.go rename to generated-usage-examples/go/driver-test/ann-basic-with-scenario.snippet.example.go diff --git a/generated-usage-examples/go/driver/ann-basic.snippet.example.go b/generated-usage-examples/go/driver-test/ann-basic.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/ann-basic.snippet.example.go rename to generated-usage-examples/go/driver-test/ann-basic.snippet.example.go diff --git a/generated-usage-examples/go/driver/ann-filter-with-scenario.snippet.example.go b/generated-usage-examples/go/driver-test/ann-filter-with-scenario.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/ann-filter-with-scenario.snippet.example.go rename to generated-usage-examples/go/driver-test/ann-filter-with-scenario.snippet.example.go diff --git a/generated-usage-examples/go/driver/ann-filter.snippet.example.go b/generated-usage-examples/go/driver-test/ann-filter.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/ann-filter.snippet.example.go rename to generated-usage-examples/go/driver-test/ann-filter.snippet.example.go diff --git a/generated-usage-examples/go/driver/create-index-basic.snippet.example.go b/generated-usage-examples/go/driver-test/create-index-basic.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/create-index-basic.snippet.example.go rename to generated-usage-examples/go/driver-test/create-index-basic.snippet.example.go diff --git a/generated-usage-examples/go/driver/create-index-filter.snippet.example.go b/generated-usage-examples/go/driver-test/create-index-filter.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/create-index-filter.snippet.example.go rename to generated-usage-examples/go/driver-test/create-index-filter.snippet.example.go diff --git a/generated-usage-examples/go/driver/create-index-without-filter-using-scenarios.snippet.example.go b/generated-usage-examples/go/driver-test/create-index-without-filter-using-scenarios.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/create-index-without-filter-using-scenarios.snippet.example.go rename to generated-usage-examples/go/driver-test/create-index-without-filter-using-scenarios.snippet.example.go diff --git a/generated-usage-examples/go/driver-test/drop-index.snippet.example.go b/generated-usage-examples/go/driver-test/drop-index.snippet.example.go new file mode 100644 index 0000000..f17adf9 --- /dev/null +++ b/generated-usage-examples/go/driver-test/drop-index.snippet.example.go @@ -0,0 +1,37 @@ +package main + +import ( + "context" + "fmt" + "log" + + + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" +) + +func main() { + ctx := context.Background() + // Replace the placeholder with your Atlas connection string + const uri = "" + + // Connect to your Atlas cluster + clientOptions := options.Client().ApplyURI(uri) + client, err := mongo.Connect(ctx, clientOptions) + if err != nil { + log.Fatalf("failed to connect to the server: %v", err) + } + defer func() { _ = client.Disconnect(ctx) }() + + // Set the namespace + coll := client.Database("sample_mflix").Collection("embedded_movies") + indexName := "vector_index" + + err = coll.SearchIndexes().DropOne(ctx, indexName) + if err != nil { + log.Fatalf("failed to delete the index: %v", err) + } + + fmt.Println("Successfully deleted the Vector Search index") +} + diff --git a/generated-usage-examples/go/driver-test/edit-index.snippet.example.go b/generated-usage-examples/go/driver-test/edit-index.snippet.example.go new file mode 100644 index 0000000..76637b6 --- /dev/null +++ b/generated-usage-examples/go/driver-test/edit-index.snippet.example.go @@ -0,0 +1,54 @@ +package main + +import ( + "context" + "fmt" + "log" + + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" +) + +func main() { + ctx := context.Background() + // Replace the placeholder with your Atlas connection string + const uri = "" + + // Connect to your Atlas cluster + clientOptions := options.Client().ApplyURI(uri) + client, err := mongo.Connect(ctx, clientOptions) + if err != nil { + log.Fatalf("failed to connect to the server: %v", err) + } + defer func() { _ = client.Disconnect(ctx) }() + + // Set the namespace + coll := client.Database("sample_mflix").Collection("embedded_movies") + indexName := "vector_index" + type vectorDefinitionField struct { + Type string `bson:"type"` + Path string `bson:"path"` + NumDimensions int `bson:"numDimensions"` + Similarity string `bson:"similarity"` + } + + type vectorDefinition struct { + Fields []vectorDefinitionField `bson:"fields"` + } + + definition := vectorDefinition{ + Fields: []vectorDefinitionField{{ + Type: "vector", + Path: "plot_embedding", + NumDimensions: 1024, + Similarity: "euclidean"}}, + } + err = coll.SearchIndexes().UpdateOne(ctx, indexName, definition) + + if err != nil { + log.Fatalf("failed to update the index: %v", err) + } + + fmt.Println("Successfully updated the search index") +} + diff --git a/generated-usage-examples/go/driver-test/enn.snippet.example.go b/generated-usage-examples/go/driver-test/enn.snippet.example.go new file mode 100644 index 0000000..f1bd925 --- /dev/null +++ b/generated-usage-examples/go/driver-test/enn.snippet.example.go @@ -0,0 +1,64 @@ +package main + +import ( + "context" + "fmt" + "log" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" +) + +func ExampleEnnQuery(t *testing.T) []ProjectedMovieResult { + ctx := context.Background() + // Replace the placeholder with your Atlas connection string + const uri = "" + + // Connect to your Atlas cluster + clientOptions := options.Client().ApplyURI(uri) + client, err := mongo.Connect(ctx, clientOptions) + if err != nil { + log.Fatalf("failed to connect to the server: %v", err) + } + defer func() { _ = client.Disconnect(ctx) }() + + // Set the namespace + coll := client.Database("sample_mflix").Collection("embedded_movies") + + queryVector := [1536]float64{ + -0.006954097, -0.009932499, -0.001311474, -0.021280076, -0.014608995, -0.008227668, -0.013274779, -0.0069271433, -0.009521453, -0.030943038, 0.017304381, 0.015094165, -0.010397454, 0.010943269, 0.012230316, 0.025943095, 0.02583528, 0.001368751, 0.009777515, -0.016024074, -0.013989056, 0.00685639, 0.030242238, -0.023881124, -0.011057823, -0.0056906347, -0.00055929273, -0.03199424, 0.0072168973, -0.023166848, 0.0033490178, -0.024069803, -0.023557678, -0.020862292, 0.007452744, -0.019002475, 0.007850314, -0.032856762, -0.012951332, 0.003005356, -0.003739849, 0.010053792, 0.019541552, 0.007702067, -0.035498243, -0.00918453, -0.0143529335, 0.000249955, -0.011866439, 0.019703276, 0.0076481593, 0.025161434, -0.015714103, -0.0076818517, -0.023180325, -0.0032883717, -0.02315337, 0.015188503, 0.031347346, -0.008739791, 0.01454161, 0.014824626, -0.025107525, 0.0012558816, -0.012803086, -0.013146748, -0.01652272, 0.01283004, -0.019352876, -0.010444623, 0.04706145, 0.030754361, 0.008820653, 0.011657547, 0.014878534, -0.010181823, 0.00041673204, -0.009103668, -0.0055255424, 0.00579845, 0.024110233, -0.020404076, -0.0066272817, -0.005299804, 0.019649368, 0.007729021, -0.0066845585, 0.025592696, 0.00575465, -0.014824626, 0.00033334352, -0.008591545, 0.004164372, 0.028085928, -0.020875769, -0.00448108, -0.009258653, 0.02535011, -0.0025538788, -0.059082873, -0.0074055744, 0.005950066, -0.014164257, -0.016185796, -0.015768012, -0.01309284, 0.0030222023, 0.0028436328, 0.0037095258, -0.0068462817, -0.010963485, 0.018988999, 0.010929792, -0.03967609, 0.016994413, -0.023503771, -0.0037903874, -0.012075332, -0.005923112, -0.01902943, 0.017978229, -0.005993866, 0.024015894, -0.017722167, 0.010875884, 0.0153637035, -0.04045775, -0.0016568204, -0.0074190516, 0.0011084777, 0.033018485, 0.021536138, 0.025794849, -0.019622413, -0.041724585, 0.014743765, -0.011111731, 0.0065666353, -0.019851523, -0.035174794, 0.007270805, 0.02698082, -0.010929792, -0.020148015, -0.009689915, 0.032182917, 0.015700627, 0.013786903, -0.0021647324, -0.0063644815, 0.027317744, 0.004403588, 0.03158993, -0.0039116796, 0.02029626, 0.04191326, -0.0050504804, 0.008416344, -0.0034602026, 0.010485054, -0.0030996946, -0.0212666, 0.0043934803, -0.016765304, -0.00039441086, 0.025538787, 0.008483729, 0.017479582, -0.0061454815, -0.018220814, -0.0025589326, 0.0102829, -0.045498125, 0.029784022, 0.017169613, 0.020592753, 0.012445947, 0.021630477, -0.031050853, -0.011327362, -0.024689741, 0.0048988652, 0.022129124, 0.0114621315, -0.026091343, 0.015067211, 0.004723665, 0.017722167, 0.014608995, -0.016805734, 0.0042250184, 0.027843343, 0.03264113, 0.007034959, -0.6852751, -0.019986292, 0.003827449, 0.0032462562, 0.006115158, -0.001972686, 0.001937309, 0.015956689, -0.010437884, 0.00803899, -0.01401601, -0.00026869634, -0.033207163, -0.00623982, -0.0048449575, -0.013193917, -0.00426208, -0.013207395, -0.014379887, 0.017991705, 0.0007264909, 0.023517247, -0.00725059, 0.0071832053, -0.003466941, -0.0072842822, 0.0028234175, -0.02460888, 0.0044608647, -0.008746529, -0.025713988, 0.012499855, 0.004882019, 0.010525485, 0.05250613, -0.003387764, -0.021212691, 0.026549557, 0.034123596, 0.014325979, -0.0080592055, -0.012189886, -0.005970281, 0.0115093, 0.0021731553, 0.033557564, 0.020929677, -0.02130703, 0.022991648, -0.03123953, 0.0102829, -0.0067721587, 0.008510683, 0.010013361, 0.031320393, 0.010646777, 0.015215457, -0.019797614, 0.0022186402, -0.0010351969, 0.0015523742, 0.021630477, 0.00751339, 0.0062162355, -0.016468812, 0.018840753, -0.02544445, 0.030943038, 0.008295052, -0.005700743, -0.0033557562, 0.020053675, -0.012722225, -0.016778782, 0.025511835, 0.025538787, 0.022802971, -0.017708689, -0.009615792, -0.00733819, 0.0049224496, -0.021590047, -0.021158785, 0.022034785, 0.046872772, -0.021064445, -0.024811033, 0.0043429416, -0.006169066, -0.0044406494, -0.003357441, 0.006445343, -0.01801866, -0.0082074525, 0.0037802798, 0.02258734, 0.0018598167, -0.0101548685, 0.020134538, -0.008214191, -0.0004830638, 0.00421828, 0.0048719114, 0.0087869605, -0.008335483, 0.023503771, -0.030161375, 0.0055929273, 0.054069456, -0.010006622, 0.018975522, 0.015956689, -0.018530782, 0.003669095, 0.014662903, -0.023126416, 0.011300408, 0.021563092, -0.00106552, -0.03269504, 0.020282784, -0.023665493, 0.025242295, -0.01801866, -0.008537637, -0.00083472754, 0.02130703, -0.008780221, 0.0080592055, -0.0012971548, 0.014838103, 0.0056704194, 0.015794965, 0.001546478, 0.013072625, 0.0057310658, 0.011711455, -0.020997062, 0.010289638, 0.0041070953, -0.025592696, 0.012661578, -0.013436502, 0.013348902, 0.014312503, -0.023894602, -0.018517306, -0.0105928695, -0.02140137, 0.0076885903, 0.03220987, -0.0042283875, -0.04649542, -0.000022110593, 0.00013803327, -0.0046293265, -0.0036286642, -0.028598052, -0.0042856648, -0.029406667, 0.026765188, 0.0027711943, -0.0059298505, -0.00311991, 0.016293611, -0.027182974, -0.011623855, 0.0030508407, -0.0035747564, -0.018032135, 0.03045787, 0.0011337469, -0.004780942, 0.012055117, -0.0081333285, 0.02908322, -0.008092898, -0.0015944897, 0.014716811, 0.014325979, -0.0037061565, -0.0074325283, -0.01854426, -0.0070821284, -0.003598341, -0.01718309, -0.0108826235, 0.014959396, -0.019366352, 0.017722167, 0.009528192, 0.022439092, -0.01630709, -0.003625295, -0.00413068, -0.007311236, -0.008503945, -0.006024189, 0.038867474, 0.030943038, 0.015956689, 0.007196682, 0.013699302, 0.0025471402, 0.026792143, -0.031832516, -0.018867707, -0.03897529, 0.04679191, 0.00421828, 0.01634752, -0.004120572, -0.009696653, -0.011414962, 0.011980994, 0.045659848, -0.010080745, -0.0045720492, -0.020794908, -0.0030205175, -0.00896216, -0.0071427743, 0.006559897, 0.0045147724, -0.032991532, 0.0059332196, 0.0033153256, 0.00426208, 0.0063779587, -0.025943095, -0.021495707, -0.008268098, -0.002429217, 0.0102829, -0.0048786495, 0.003584864, 0.004737142, -0.029244944, 0.027169496, 0.010599608, -0.008517422, -0.0016652435, 0.023544202, -0.022398662, 0.010202038, 0.0029211252, 0.021185739, -0.01708875, -0.03396187, 0.025121003, -0.009838161, 0.015633242, -0.015525427, 0.003743218, 0.0044676033, -0.021819154, -0.006802482, -0.023126416, 0.028112883, 0.03045787, 0.015255888, -0.008685883, -0.010943269, -0.0039386335, -0.0014950972, -0.009043022, -0.0023264554, -0.0028975406, -0.0021377786, 0.002860479, -0.0010166661, -0.01173167, 0.03040396, -0.028005067, -0.00509765, -0.008463514, 0.019959338, -0.012533547, -0.012782871, -0.0055558654, 0.004807896, -0.018800322, 0.005582819, 0.017991705, -0.005505327, -0.008382652, 0.0011404854, -0.0035073718, -0.017587397, 0.012890686, -0.0015363704, -0.000308706, 0.011603639, -0.0042452337, -0.027129065, -0.0086387135, 0.023786787, -0.024352817, -0.015175027, 0.017546967, 0.0064318664, 0.0100874845, -0.008605022, -0.006529574, 0.014703333, -0.0010318276, -0.012290963, -0.014622472, -0.008382652, -0.000661212, 0.0044170646, 0.009386684, -0.0030660022, 0.0033102715, -0.007095605, 0.007978344, -0.016980935, -0.0040262337, 0.022344755, 0.0077357595, 0.0063341586, -0.016482288, -0.028220698, -0.026899958, 0.08291009, 0.014002534, 0.00075428706, 0.013018717, 0.0013485356, -0.0223178, -0.016697919, -0.018584691, 0.0057378043, 0.007924437, 0.0032850024, -0.01735829, 0.029730113, 0.021684386, -0.008382652, 0.017021365, 0.0030811639, -0.008025514, 0.0043564187, -0.000044694985, -0.0038375566, -0.012924379, -0.012230316, 0.0345279, -0.014689857, -0.019406782, 0.008780221, 0.0092923455, -0.01555238, -0.01920463, -0.01827472, -0.00305421, -0.017573921, 0.016320566, 0.02548488, 0.02105097, 0.012823301, 0.03431227, 0.026589988, -0.025606172, 0.007755975, 0.0019693167, 0.0096494835, -0.034069687, 0.0067721587, 0.0004190484, 0.005508696, 0.033207163, -0.0011792317, -0.012648102, 0.022829924, 0.015821919, -0.035956457, -0.038732704, -0.020740999, 0.0063880663, -0.010471577, -0.006933882, 0.005936589, 0.015889304, -0.00852416, -0.031455163, 0.009305822, 0.0051178653, -0.027452512, -0.015700627, -0.017762598, -0.005869204, -0.0065531586, -0.011879916, -0.008220929, -0.0053503425, -0.0026920172, -0.00038830412, 0.019959338, -0.010444623, -0.00047548304, -0.015040257, 0.0008330429, 0.008005298, -0.0075336057, -0.02117226, -0.027250359, -0.018962044, -0.006138743, 0.014918964, -0.014757241, -0.013867764, 0.0006961678, 0.01726395, -0.0039352644, 0.005724327, 0.019878477, 0.009494499, 0.0071832053, -0.0023652017, 0.004865173, 0.029784022, 0.002390471, 0.0005854043, 0.00034387235, 0.0053975116, -0.011650808, 0.005218942, 0.007136036, -0.0091440985, 0.005879312, 0.028193744, -0.024662787, -0.0029447097, 0.009636007, -0.029730113, 0.00025206077, 0.006745205, 0.011522777, 0.02035017, 0.026131773, 0.029972699, 0.008012037, -0.012466162, 0.012459424, -0.01836906, 0.0051515577, 0.022196509, -0.015970165, 0.0037465873, -0.008396129, -0.009494499, -0.0036657257, 0.011219546, -0.01823429, 0.013524102, 0.015134595, 0.020269306, -0.0028891175, 0.008456775, 0.0051650344, 0.011131947, -0.0038948336, -0.010909577, -0.010485054, -0.026859527, -0.005475004, -0.0036589873, 0.0034602026, -0.026253065, -0.010350284, 0.0137734255, 0.0030828484, 0.012526809, -0.026131773, -0.02363854, 0.00024321652, -0.015956689, -0.0042991415, -0.027762482, -0.012782871, -0.016940504, 0.01256724, 0.03598341, 0.026387835, 0.0013763318, 0.0041946955, 0.0017520012, -0.007755975, -0.011179116, 0.003537695, 0.011522777, -0.035929505, 0.021037493, 0.041859355, 0.034770485, -0.012769394, 0.0059534353, 0.02851719, 0.017749121, -0.011017392, 0.0059568044, -0.02105097, -0.011233023, 0.0095079765, -0.0019002475, -0.006472297, -0.00826136, -0.011495824, -0.024056325, 0.00628362, 0.0028689022, 0.0050808038, 0.00632742, 0.020228876, -0.0029767177, 0.0327759, -0.016859643, 0.0006439447, -0.01516155, 0.015889304, 0.0032765793, -0.0017570552, 0.016509242, 0.0076481593, 0.0033254332, -0.012513332, -0.0073718824, -0.012237055, 0.025997004, -0.0052122036, -0.0007530236, -0.01739872, -0.020188445, -0.0005908793, -0.011212808, 0.008840868, -0.015741058, 0.0034197718, -0.0033456485, -0.010262684, 0.010080745, -0.016751828, -0.04415043, 0.010202038, 0.0058557275, 0.023369001, 0.009238438, 0.04029603, 0.009743823, -0.006802482, -0.01502678, 0.01634752, -0.018301675, 0.011313885, 0.030080514, 0.009501237, 0.000942543, -0.007755975, -0.015242411, 0.003898203, -0.017236996, -0.026172204, 0.02394851, 0.0065834816, 0.021617, 0.0054514194, -0.039487414, -0.021549616, 0.018813798, -0.025848757, 0.0026566405, -0.011199331, -0.024635833, -0.01129367, 0.010181823, -0.033638425, 0.033072393, -0.008537637, -0.02597005, 0.010444623, -0.037169382, -0.0003693522, 0.008793699, -0.006647497, 0.014716811, -0.026023958, -0.011455393, 0.0012853625, -0.0063072047, -0.01103087, -0.0034736795, -0.010390716, 0.021913493, -0.021509185, 0.0022085323, -0.003756695, 0.009656223, 0.016549673, 0.0022186402, -0.020687092, -0.029056268, -0.00065447355, -0.0035309563, 0.009305822, 0.007958129, -0.0086387135, -0.02035017, -0.029298851, -0.007479698, -0.0205658, -0.0051178653, -0.003770172, -0.02394851, -0.020174969, 0.010053792, -0.014325979, 0.014811149, -0.0015481627, -0.0060073426, -0.0028116251, 0.04091597, -0.026873004, 0.00038851472, 0.0037769105, 0.017344812, -0.003067687, 0.023099463, 0.0015094165, -0.030296145, 0.045012955, -0.035147842, -0.0067553124, 0.0090025915, 0.0063408967, 0.020538846, -0.0011295355, 0.0006153062, 0.03870575, 0.03840926, 0.007486436, -0.040619474, -0.0059466967, 0.033934917, 0.018813798, 0.026037434, 0.0026195787, -0.010424407, 0.011960777, -0.0032277254, 0.007924437, 0.011617116, -0.028328514, -0.024622357, 0.0014639319, 0.025147956, -0.00003919366, -0.008800437, -0.0345279, 0.009757299, -0.003044102, 0.023786787, 0.008989114, -0.018207336, -0.0035612795, 0.0025185018, -0.00079050637, -0.00048643304, 0.0041778493, -0.00927213, -0.014285549, -0.018705983, -0.024150664, -0.021509185, -0.0032193023, 0.028220698, -0.005720958, 0.00070711784, -0.016953982, -0.0071629896, -0.02702125, 0.0040093875, 0.00628362, -0.0021411476, 0.029110175, 0.018220814, 0.0071562515, 0.022924263, 0.0076144673, -0.002565671, 0.0020771322, 0.004016126, -0.007836836, 0.0016509243, 0.005485112, 0.0061050504, -0.018988999, 0.0060713585, -0.0017823244, 0.0054413117, -0.0059837583, -0.0060342965, 0.013348902, -0.0223178, -0.01300524, -0.013261302, -0.0058995276, 0.030377006, -0.002319717, -0.02948753, 0.0110982545, 0.000072175295, -0.006657605, -0.031131715, 0.00733819, -0.0033186947, -0.02649565, 0.0060983123, 0.011441916, -0.014555087, 0.007291021, -0.017735643, 0.03654944, 0.024622357, 0.0003013358, 0.02227737, 0.0105457, 0.025026664, -0.0013965472, -0.012836779, -0.017803028, 0.0021849477, 0.025997004, 0.00009791834, 0.007048436, -0.00032555216, 0.026131773, -0.025053618, 0.01361844, -0.023517247, -0.0023230864, -0.014892011, 0.016239705, 0.022021309, -0.016967459, 0.019056384, 0.0047539882, 0.0029598714, -0.0013519048, -0.0045585725, 0.0015439511, 0.021509185, -0.0050909114, 0.029999653, 0.00074712746, -0.011354316, -0.0037735412, 0.0031805562, -0.0055962964, 0.019298967, 0.18652076, -0.010640038, 0.0029514483, 0.018962044, -0.0013190547, 0.011852963, 0.020444507, -0.004720296, 0.0021344093, -0.0016542935, -0.008005298, 0.013854287, 0.0020181707, 0.007210159, -0.0037162642, -0.0023129785, -0.03415055, -0.03202119, -0.023665493, 0.012621148, 0.00927213, -0.006630651, -0.007958129, -0.009379946, 0.026172204, -0.006947359, -0.008679145, -0.0073516667, 0.01739872, 0.0014209741, -0.000361982, 0.012142717, -0.0030036713, 0.0080592055, -0.021873062, -0.0064116507, 0.008227668, -0.028598052, 0.0013156856, 0.018476875, -0.014231641, 0.010929792, 0.0066373893, 0.03840926, 0.015565857, 0.009777515, -0.0049628806, 0.006920405, 0.019528076, 0.030646546, -0.028948452, -0.008335483, 0.012412256, 0.040942922, 0.016482288, 0.022021309, 0.0041946955, 0.0058759428, -0.011219546, -0.022021309, -0.016401427, 0.020660138, -0.02632045, 0.023355525, -0.018759891, 0.014299026, -0.029406667, 0.0076346826, 0.019891953, -0.021387892, -0.0071629896, -0.014110349, -0.026684327, -0.004797788, -0.015606288, -0.006570005, 0.034986116, 0.006738466, -0.009838161, 0.0011303778, -0.010538962, -0.03444704, 0.00685639, -0.003888095, -0.009494499, -0.013800379, 0.017236996, 0.017614352, -0.017546967, 0.017614352, 0.0024612248, -0.0006982736, -0.008800437, 0.0016677704, -0.004666388, -0.0050605885, 0.018975522, 0.009602315, -0.0034416718, -0.01401601, -0.018247766, -0.00032576272, 0.005114496, 0.009016068, -0.009609053, -0.0049662497, -0.001726732, 0.0019339399, -0.010774808, -0.004016126, -0.0065127276, -0.018759891, 0.0020063785, -0.0052661113, -0.0073449286, 0.0017671628, -0.034905255, -0.014218165, 0.004235126, -0.019649368, 0.00010865777, -0.025727466, 0.030781314, -0.00861176, -0.016158843, -0.016617058, -0.01454161, -0.0020333321, 0.002092294, -0.032533314, 0.006206128, -0.029433621, 0.004663019, -0.023625063, -0.021199215, 0.0073988363, 0.007715544, 0.00680922, -0.01103087, 0.012270748, 0.012614409, -0.034420088, -0.003898203, 0.015848873, -0.0030828484, -0.0054244655, 0.030107468, 0.002491548, -0.009993146, -0.014824626, -0.026266541, -0.000074912794, -0.0048719114, -0.012277486, 0.014770718, -0.021428322, -0.03506698, -0.013086102, -0.0028571098, 0.024554972, -0.03439313, -0.010902839, 0.04474342, -0.017196566, 0.0026819096, 0.00081240636, -0.17476887, 0.004710188, 0.024231525, -0.00033229063, 0.025902664, 0.027762482, 0.008268098, 0.00016561887, 0.00027080212, 0.0032934255, 0.011799055, 0.004161003, -0.037519783, 0.007243851, -0.0018901399, -0.00799856, -0.024460632, 0.008295052, -0.010821977, 0.0101548685, 0.017681736, 0.0082748365, -0.008840868, -0.01722352, 0.013793641, 0.015983643, 0.003409664, 0.041589815, -0.010896101, 0.0017722166, -0.03282981, -0.0031249637, 0.02359811, 0.01058613, -0.0003004935, -0.0016248127, -0.027924204, -0.016360996, -0.0048516956, 0.014905488, 0.0036724643, 0.009063237, 0.030781314, -0.023854172, -0.013706041, 0.0202154, 0.011340839, -0.013604964, 0.013692563, -0.005879312, 0.0024157402, 0.0071764668, -0.01630709, 0.0032850024, 0.003343964, -0.00404308, 0.012095547, -0.009898807, 0.004764096, -0.0030744253, -0.031428207, -0.015821919, -0.0012407202, -0.024447156, -0.011718193, -0.013658872, -0.011542993, -0.0046832343, -0.0051347115, 0.0032277254, 0.004464234, -0.002718971, -0.0057613887, -0.016953982, 0.01419121, 0.0064891432, -0.012668317, 0.0038914643, -0.0018193859, -0.004652911, -0.022910787, 0.026953865, 0.012890686, -0.009993146, -0.0041407878, -0.0024629096, -0.009541669, 0.020687092, -0.015175027, -0.022735586, 0.01485158, -0.029945744, -0.020377122, -0.010714161, 0.008160283, 0.010714161, -0.022439092, 0.010330069, -0.016563151, -0.012836779, 0.017439151, 0.014258595, -0.029891837, 0.00896216, 0.03506698, 0.005936589, 0.02548488, 0.0067283586, 0.035821687, 0.0056569427, 0.005993866, 0.028490236, 0.011320624, 0.021792201, 0.012904163, 0.025377065, 0.007742498, 0.01634752, 0.016590104, 0.01792432, 0.04517468, 0.0029935637, -0.019689798, 0.0025892558, -0.0055524963, -0.0068867127, -0.10786937, -0.030484822, 0.008146806, 0.025916142, -0.0038375566, 0.014918964, -0.0076481593, -0.003224356, -0.0068833437, 0.010559177, -0.0007584986, -0.020242354, -0.021738293, -0.007884006, 0.05703438, 0.0015296319, -0.008706098, -0.01331521, -0.0153637035, 0.03862489, -0.010437884, 0.015121119, -0.0012070278, -0.007553821, -0.0088543445, -0.0060511427, -0.01349041, 0.018220814, -0.018557737, -0.011987732, -0.012358348, -0.0053503425, -0.000028559516, -0.020148015, -0.011866439, -0.004289034, -0.010896101, -0.012412256, 0.011482347, -0.0310239, 0.01813995, 0.03827449, -0.009406899, -0.022991648, 0.009838161, -0.02262777, 0.023678971, 0.013375856, -0.009171053, -0.020094106, -0.01753349, -0.025188388, -0.03291067, 0.0043463106, 0.009689915, -0.00725059, 0.0070147435, 0.0063948045, -0.016940504, 0.032991532, 0.000852416, -0.002139463, -0.028948452, 0.014689857, -0.0056434656, 0.014299026, -0.013827333, -0.007958129, 0.024864942, -0.0134836715, -0.018422967, 0.013908194, -0.021037493, 0.004336203, -0.03911006, -0.012627886, -0.019002475, 0.0013670664, 0.0411316, -0.009514715, -0.031455163, -0.020377122, 0.0021647324, -0.01906986, 0.027843343, 0.018854229, -0.0076616365, 0.0032614178, -0.000111395275, -0.010693946, -0.003945372, 0.022209985, 0.040349938, -0.03870575, 0.008692621, 0.02043103, 0.0026044173, -0.019460691, -0.0032614178, 0.010040315, -0.025026664, -0.0015102588, -0.047142312, 0.043665264, -0.0054985886, -0.007243851, -0.0024831248, 0.00084441405, 0.025956573, -0.010889362, -0.00733819, 0.018759891, -0.011866439, 0.014959396, -0.008578068, 0.0027206559, -0.025067095, -0.012499855, 0.023180325, 0.014865057, 0.012452686, -0.0034905255, 0.0030727407, -0.0048752804, 0.028840637, 0.01718309, -0.010444623, -0.020498415, -0.018921614, 0.012392039, -0.0086387135, -0.0219674, 0.024285434, -0.019083338, -0.013086102, 0.01801866, 0.02029626, -0.025471402, -0.011482347, 0.0011126893, 0.015754534, 0.04846305, -0.026118295, -0.020336691, 0.017075274, -0.007850314, 0.014177733, 0.030862177, 0.007958129, 0.018881183, 0.013375856, 0.001256724, 0.006981051, 0.028705867, -0.0033405947, -0.010309854, -0.020511892, -0.008254621, 0.03695375, 0.0015549011, 0.024730172, 0.0038375566, 0.025740942, 0.024528017, 0.005171773, 0.00013319, 0.009588838, -0.0029733484, -0.004454126, -0.01199447, -0.012135978, -0.02830156, 0.007958129, 0.006859759, 0.009110407, -0.005505327, -0.0067519434, 0.005225681, 0.011772101, 0.014218165, -0.024878418, 0.008955422, 0.00900933, 0.015094165, -0.038867474, 0.018503828, 0.012243793, 0.012843517, -0.020727523, 0.008193975, -0.013935149, 0.014838103, 0.012695271, 0.0004902234, 0.005950066, 0.015929734, -0.006994528, 0.021374416, -0.0093597295, -0.009440592, 0.017749121, 0.004908973, 0.0036926796, -0.005458158, -0.00799856, -0.015646718, -0.008517422, 0.0074729593, -0.012991764, -0.0061623277, -0.00944733, 0.0032529947, 0.013261302, -0.003827449, 0.0026212635, 0.0037769105, -0.0029143868, 0.0013325317, 0.0024797556, -0.005124604, -0.03989172, 0.019568507, 0.0100874845, 0.016280135, -0.0003554541, -0.025565742, 0.012560502, -0.010491792, 0.008631975, -0.00904976, -0.00016856696, 0.006010712, 0.010781546, -0.0020670246, -0.021873062, -0.011859701, -0.00040346567, 0.008665668, 0.016199274, 0.04204803, -0.036091227, 0.032102056, 0.02043103, 0.008402867, 0.013766687, -0.020201921, 0.0054682656, -0.0037027872, -0.01221684, 0.0030036713, -0.027573805, 0.0054076193, 0.001863186, -0.006357743, -0.029137129, -0.0096697, 0.007675113, -0.0153637035, -0.014878534, 0.0060612503, 0.001300524, 0.030484822, 0.003800495, 0.018908137, 0.01840949, -0.00082461984, -0.030808268, 0.014918964, -0.013254563, -0.0036050796, -0.009319299, -0.011920347, -0.0059062657, -0.020714046, -0.0051347115, 0.02737165, 0.005198727, -0.0059601734, -0.027519897, 0.026967343, 0.0007357563, 0.010431146, 0.017654782, -0.019797614, -0.039137013, 0.033099346, 0.0023129785, -0.011017392, -0.0032816331, -0.020848814, + } + + vectorSearchStage := bson.D{ + {"$vectorSearch", bson.D{ + {"index", "vector_index"}, + {"path", "plot_embedding"}, + {"queryVector", queryVector}, + {"exact", true}, + {"limit", 10}, + }}} + + projectStage := bson.D{ + {"$project", bson.D{ + {"_id", 0}, + {"plot", 1}, + {"title", 1}, + {"score", bson.D{{"$meta", "vectorSearchScore"}}}, + }}} + + cursor, err := coll.Aggregate(ctx, mongo.Pipeline{vectorSearchStage, projectStage}) + if err != nil { + log.Fatalf("failed to retrieve data from the server: %v", err) + } + + var results []ProjectedMovieResult + if err = cursor.All(ctx, &results); err != nil { + log.Fatalf("failed to unmarshal retrieved docs to ProjectedMovieResult objects: %v", err) + } + for _, result := range results { + fmt.Printf("Title: %v \nPlot: %v \nScore: %v \n\n", result.Title, result.Plot, result.Score) + } + return results +} + diff --git a/generated-usage-examples/go/driver/view-index.snippet.example.go b/generated-usage-examples/go/driver-test/view-index.snippet.example.go similarity index 100% rename from generated-usage-examples/go/driver/view-index.snippet.example.go rename to generated-usage-examples/go/driver-test/view-index.snippet.example.go