@@ -6,7 +6,7 @@ import { type MongoDataAPIError } from "./errors.js";
66// eslint-disable-next-line @typescript-eslint/ban-types
77type Nullable < T > = T | null ;
88
9- /** A data API response object */
9+ /** A generic data API response object */
1010export type DataAPIResponse < T > = { data ?: T ; error ?: MongoDataAPIError } ;
1111
1212export type FindOneRequestOptions = { projection ?: Document ; sort ?: Document } ;
@@ -16,33 +16,33 @@ export type FindOneResponse<TSchema> = Promise<
1616 DataAPIResponse < Nullable < WithId < TSchema > > >
1717> ;
1818
19- /** The MongoDB-specific options for this API method */
19+ /** The MongoDB-specific options for the find() method */
2020export type FindRequestOptions = {
2121 projection ?: Document ;
2222 sort ?: Sort ;
2323 limit ?: number ;
2424 skip ?: number ;
2525} ;
2626
27- /** A data API response object */
27+ /** A data API response object for the find() method */
2828export type FindResponse < TSchema > = Promise <
2929 DataAPIResponse < Array < WithId < TSchema > > >
3030> ;
3131
32- /** A data API response object */
32+ /** A data API response object for the insertOne() method */
3333export type InsertOneResponse = Promise <
3434 DataAPIResponse < { insertedId : ObjectId } >
3535> ;
3636
37- /** A data API response object */
37+ /** A data API response object for the insertMany() method */
3838export type InsertManyResponse = Promise <
3939 DataAPIResponse < { insertedIds : string [ ] } >
4040> ;
4141
42- /** The MongoDB-specific options for this API method */
42+ /** The MongoDB-specific options for the updateOne() method */
4343export type UpdateOneRequestOptions = { upsert ?: boolean } ;
4444
45- /** A data API response object */
45+ /** A data API response object for the updateOne() method */
4646export type UpdateOneResponse = Promise <
4747 DataAPIResponse < {
4848 matchedCount : number ;
@@ -51,10 +51,10 @@ export type UpdateOneResponse = Promise<
5151 } >
5252> ;
5353
54- /** The MongoDB-specific options for this API method */
54+ /** The MongoDB-specific options for the updateMany() method */
5555export type UpdateManyRequestOptions = { upsert ?: boolean } ;
5656
57- /** A data API response object */
57+ /** A data API response object for the updateMany() method */
5858export type UpdateManyResponse = Promise <
5959 DataAPIResponse < {
6060 matchedCount : number ;
@@ -63,10 +63,10 @@ export type UpdateManyResponse = Promise<
6363 } >
6464> ;
6565
66- /** The MongoDB-specific options for this API method */
66+ /** The MongoDB-specific options for the replaceOne() method */
6767export type ReplaceOneRequestOptions = { upsert ?: boolean } ;
6868
69- /** A data API response object */
69+ /** A data API response object for the replaceOne() method */
7070export type ReplaceOneResponse = Promise <
7171 DataAPIResponse < {
7272 matchedCount : number ;
@@ -75,17 +75,17 @@ export type ReplaceOneResponse = Promise<
7575 } >
7676> ;
7777
78- /** A data API response object */
78+ /** A data API response object for the deleteOne() method */
7979export type DeleteOneResponse = Promise <
8080 DataAPIResponse < { deletedCount : number } >
8181> ;
8282
83- /** A data API response object */
83+ /** A data API response object for the deleteMany() method */
8484export type DeleteManyResponse = Promise <
8585 DataAPIResponse < { deletedCount : number } >
8686> ;
8787
88- /** A data API response object */
88+ /** A data API response object for the aggregate() method */
8989export type AggregateResponse < TOutput = Document > = Promise <
9090 DataAPIResponse < TOutput [ ] >
9191> ;
0 commit comments