package documentation_examples
import "go.mongodb.org/mongo-driver/examples/documentation_examples"
Index ¶
- func AggregationExamples(t *testing.T, db *mongo.Database)
- func ChangeStreamExamples(t *testing.T, db *mongo.Database)
- func CommitWithRetry(sctx mongo.SessionContext) error
- func DeleteExamples(t *testing.T, db *mongo.Database)
- func IndexExamples(t *testing.T, db *mongo.Database)
- func InsertExamples(t *testing.T, db *mongo.Database)
- func ProjectionExamples(t *testing.T, db *mongo.Database)
- func QueryArrayEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database)
- func QueryArraysExamples(t *testing.T, db *mongo.Database)
- func QueryEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database)
- func QueryNullMissingFieldsExamples(t *testing.T, db *mongo.Database)
- func QueryToplevelFieldsExamples(t *testing.T, db *mongo.Database)
- func RunCommandExamples(t *testing.T, db *mongo.Database)
- func RunTransactionWithRetry(sctx mongo.SessionContext, txnFn func(mongo.SessionContext) error) error
- func TransactionsExamples(ctx context.Context, client *mongo.Client) error
- func UpdateEmployeeInfo(ctx context.Context, client *mongo.Client) error
- func UpdateExamples(t *testing.T, db *mongo.Database)
- func VersionedAPIDeprecationErrorsExample()
- func VersionedAPIExample()
- func VersionedAPIExamples()
- func VersionedAPINonStrictExample()
- func VersionedAPIStrictExample()
- func WithTransactionExample()
Functions ¶
func AggregationExamples ¶
AggregationExamples contains examples of aggregation operations.
func ChangeStreamExamples ¶
ChangeStreamExamples contains examples of changestream operations.
func CommitWithRetry ¶
func CommitWithRetry(sctx mongo.SessionContext) error
CommitWithRetry is an example function demonstrating transaction commit with retry logic.
func DeleteExamples ¶
DeleteExamples contains examples of delete operations.
func IndexExamples ¶
IndexExamples contains examples of Index operations.
func InsertExamples ¶
InsertExamples contains examples for insert operations.
func ProjectionExamples ¶
ProjectionExamples contains examples for specifying projections in find operations.
func QueryArrayEmbeddedDocumentsExamples ¶
QueryArrayEmbeddedDocumentsExamples contains examples for querying fields with arrays and embedded documents.
func QueryArraysExamples ¶
QueryArraysExamples contains examples for querying array fields.
func QueryEmbeddedDocumentsExamples ¶
QueryEmbeddedDocumentsExamples contains examples for querying embedded document fields.
func QueryNullMissingFieldsExamples ¶
QueryNullMissingFieldsExamples contains examples for querying fields that are null or missing.
func QueryToplevelFieldsExamples ¶
QueryToplevelFieldsExamples contains examples for querying top-level fields.
func RunCommandExamples ¶
RunCommandExamples contains examples of RunCommand operations.
func RunTransactionWithRetry ¶
func RunTransactionWithRetry(sctx mongo.SessionContext, txnFn func(mongo.SessionContext) error) error
RunTransactionWithRetry is an example function demonstrating transaction retry logic.
func TransactionsExamples ¶
TransactionsExamples contains examples for transaction operations.
func UpdateEmployeeInfo ¶
UpdateEmployeeInfo is an example function demonstrating transactions.
func UpdateExamples ¶
UpdateExamples contains examples of update operations.
func VersionedAPIDeprecationErrorsExample ¶
func VersionedAPIDeprecationErrorsExample()
VersionedAPIDeprecationErrorsExample is an example of creating a client with versioned API with deprecation errors.
func VersionedAPIExample ¶
func VersionedAPIExample()
VersionedAPIExample is an example of creating a client with versioned API.
func VersionedAPIExamples ¶
func VersionedAPIExamples()
VersionedAPIExamples runs all versioned API examples.
func VersionedAPINonStrictExample ¶
func VersionedAPINonStrictExample()
VersionedAPINonStrictExample is an example of creating a client with non-strict versioned API.
func VersionedAPIStrictExample ¶
func VersionedAPIStrictExample()
VersionedAPIStrictExample is an example of creating a client with strict versioned API.
func WithTransactionExample ¶
func WithTransactionExample()
WithTransactionExample is an example of using the Session.WithTransaction function.
Source Files ¶
examples.go
- Version
- v1.7.0
- Published
- Jul 20, 2021
- Platform
- darwin/amd64
- Imports
- 15 packages
- Last checked
- 8 seconds ago –
Tools for package owners.