@@ -110,8 +110,8 @@ public struct Pipeline: @unchecked Sendable {
110110  /// // let pipeline: Pipeline = ... // Assume a pipeline is already configured.
111111  /// do {
112112  ///   let snapshot = try await pipeline.execute()
113-   ///   // Process snapshot.documents 
114-   ///   print("Pipeline executed successfully: \(snapshot.documents )")
113+   ///   // Process snapshot.results 
114+   ///   print("Pipeline executed successfully: \(snapshot.results )")
115115  /// } catch {
116116  ///   print("Pipeline execution failed: \(error)")
117117  /// }
@@ -301,7 +301,7 @@ public struct Pipeline: @unchecked Sendable {
301301  /// // let pipeline: Pipeline = ... // Assume initial pipeline.
302302  /// // Limit results to the top 10 highest-rated books.
303303  /// let topTenPipeline = pipeline
304-   ///                      .sort(Descending( Field("rating")) )
304+   ///                      .sort([ Field("rating").descending()] )
305305  ///                      .limit(10)
306306  /// // let results = try await topTenPipeline.execute()
307307  /// ```
@@ -320,7 +320,7 @@ public struct Pipeline: @unchecked Sendable {
320320  /// ```swift
321321  /// // let pipeline: Pipeline = ... // Assume initial pipeline.
322322  /// // Get a list of unique author and genre combinations.
323-   /// let distinctAuthorsGenresPipeline = pipeline.distinct("author", "genre")
323+   /// let distinctAuthorsGenresPipeline = pipeline.distinct([ "author", "genre"] )
324324  /// // To further select only the author:
325325  /// //   .select("author")
326326  /// // let results = try await distinctAuthorsGenresPipeline.execute()
@@ -375,11 +375,11 @@ public struct Pipeline: @unchecked Sendable {
375375  /// // let pipeline: Pipeline = ... // Assume pipeline from "books" collection.
376376  /// // Calculate the average rating for each genre.
377377  /// let groupedAggregationPipeline = pipeline.aggregate(
378-   ///   [AggregateWithas(aggregate: average( Field("rating")), alias:  "avg_rating")],
378+   ///   [Field("rating").average().as( "avg_rating")],
379379  ///   groups: [Field("genre")] // Group by the "genre" field.
380380  /// )
381381  /// // let results = try await groupedAggregationPipeline.execute()
382-   /// // results.documents  might be:
382+   /// // snapshot.results  might be:
383383  /// // [
384384  /// //   ["genre": "SciFi", "avg_rating": 4.5],
385385  /// //   ["genre": "Fantasy", "avg_rating": 4.2]
@@ -562,7 +562,7 @@ public struct Pipeline: @unchecked Sendable {
562562  /// // Field("topic").as("category")])
563563  ///
564564  /// // Emit documents from both "books" and "magazines" collections.
565-   /// let combinedPipeline = booksPipeline.union(with: [ magazinesPipeline] )
565+   /// let combinedPipeline = booksPipeline.union(with: magazinesPipeline)
566566  /// // let results = try await combinedPipeline.execute()
567567  /// ```
568568  ///
0 commit comments