@@ -645,13 +645,15 @@ func (c *Client) Database(name string, opts ...*options.DatabaseOptions) *Databa
645
645
return newDatabase (c , name , opts ... )
646
646
}
647
647
648
- // ListDatabases performs a listDatabases operation and returns the result.
648
+ // ListDatabases executes a listDatabases command and returns the result.
649
649
//
650
- // The filter parameter should be a document containing query operatiors and can be used to select which
650
+ // The filter parameter must be a document containing query operators and can be used to select which
651
651
// databases are included in the result. It cannot be nil. An empty document (e.g. bson.D{}) should be used to include
652
652
// all databases.
653
653
//
654
654
// The opts paramter can be used to specify options for this operation (see the options.ListDatabasesOptions documentation).
655
+ //
656
+ // For more information about the command, see https://docs.mongodb.com/manual/reference/command/listDatabases/.
655
657
func (c * Client ) ListDatabases (ctx context.Context , filter interface {}, opts ... * options.ListDatabasesOptions ) (ListDatabasesResult , error ) {
656
658
if ctx == nil {
657
659
ctx = context .Background ()
@@ -705,12 +707,17 @@ func (c *Client) ListDatabases(ctx context.Context, filter interface{}, opts ...
705
707
return newListDatabasesResultFromOperation (op .Result ()), nil
706
708
}
707
709
708
- // ListDatabaseNames performs a listDatabases operation and returns a slice containing the names of all of the databases
710
+ // ListDatabaseNames executes a listDatabases command and returns a slice containing the names of all of the databases
709
711
// on the server.
710
712
//
711
- // The filter parameter should be a document containing query operators and can be used to select which databases
713
+ // The filter parameter must be a document containing query operators and can be used to select which databases
712
714
// are included in the result. It cannot be nil. An empty document (e.g. bson.D{}) should be used to include all
713
715
// databases.
716
+ //
717
+ // The opts parameter can be used to specify options for this operation (see the options.ListDatabasesOptions
718
+ // documentation.)
719
+ //
720
+ // For more information about the command, see https://docs.mongodb.com/manual/reference/command/listDatabases/.
714
721
func (c * Client ) ListDatabaseNames (ctx context.Context , filter interface {}, opts ... * options.ListDatabasesOptions ) ([]string , error ) {
715
722
opts = append (opts , options .ListDatabases ().SetNameOnly (true ))
716
723
@@ -775,15 +782,16 @@ func (c *Client) UseSessionWithOptions(ctx context.Context, opts *options.Sessio
775
782
return fn (sessCtx )
776
783
}
777
784
778
- // Watch returns a change stream for all changes on the connected deployment. See https://docs.mongodb.com/manual/changeStreams/
779
- // for more information about change streams.
785
+ // Watch returns a change stream for all changes on the deployment. See
786
+ // https://docs.mongodb.com/manual/changeStreams/ for more information about change streams.
780
787
//
781
788
// The client must be configured with read concern majority or no read concern for a change stream to be created
782
789
// successfully.
783
790
//
784
- // The pipeline parameter should be an array of documents, each representing a pipeline stage. See
785
- // https://docs.mongodb.com/manual/changeStreams/ for a list of pipeline stages that can be used with change streams.
786
- // For a pipeline of bson.D documents, the mongo.Pipeline{} type can be used.
791
+ // The pipeline parameter must be an array of documents, each representing a pipeline stage. The pipeline cannot be
792
+ // nil or empty. The stage documents must all be non-nil. See https://docs.mongodb.com/manual/changeStreams/ for a list
793
+ // of pipeline stages that can be used with change streams. For a pipeline of bson.D documents, the mongo.Pipeline{}
794
+ // type can be used.
787
795
//
788
796
// The opts parameter can be used to specify options for change stream creation (see the options.ChangeStreamOptions
789
797
// documentation).
0 commit comments