documentation_examples

package
v1.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregationExamples added in v1.5.0

func AggregationExamples(t *testing.T, db *mongo.Database)

AggregationExamples contains examples of aggregation operations.

func ChangeStreamExamples added in v1.0.0

func ChangeStreamExamples(t *testing.T, db *mongo.Database)

ChangeStreamExamples contains examples of changestream operations.

func CommitWithRetry added in v1.0.0

func CommitWithRetry(sctx mongo.SessionContext) error

CommitWithRetry is an example function demonstrating transaction commit with retry logic.

func DeleteExamples

func DeleteExamples(t *testing.T, db *mongo.Database)

DeleteExamples contains examples of delete operations.

func IndexExamples added in v1.5.0

func IndexExamples(t *testing.T, db *mongo.Database)

IndexExamples contains examples of Index operations.

func InsertExamples

func InsertExamples(t *testing.T, db *mongo.Database)

InsertExamples contains examples for insert operations.

func ProjectionExamples

func ProjectionExamples(t *testing.T, db *mongo.Database)

ProjectionExamples contains examples for specifying projections in find operations.

func QueryArrayEmbeddedDocumentsExamples

func QueryArrayEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database)

QueryArrayEmbeddedDocumentsExamples contains examples for querying fields with arrays and embedded documents.

func QueryArraysExamples

func QueryArraysExamples(t *testing.T, db *mongo.Database)

QueryArraysExamples contains examples for querying array fields.

func QueryEmbeddedDocumentsExamples

func QueryEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database)

QueryEmbeddedDocumentsExamples contains examples for querying embedded document fields.

func QueryNullMissingFieldsExamples

func QueryNullMissingFieldsExamples(t *testing.T, db *mongo.Database)

QueryNullMissingFieldsExamples contains examples for querying fields that are null or missing.

func QueryToplevelFieldsExamples

func QueryToplevelFieldsExamples(t *testing.T, db *mongo.Database)

QueryToplevelFieldsExamples contains examples for querying top-level fields.

func RunCommandExamples added in v1.5.0

func RunCommandExamples(t *testing.T, db *mongo.Database)

RunCommandExamples contains examples of RunCommand operations.

func RunTransactionWithRetry added in v1.0.0

func RunTransactionWithRetry(sctx mongo.SessionContext, txnFn func(mongo.SessionContext) error) error

RunTransactionWithRetry is an example function demonstrating transaction retry logic.

func TransactionsExamples added in v1.0.0

func TransactionsExamples(ctx context.Context, client *mongo.Client) error

TransactionsExamples contains examples for transaction operations.

func UpdateEmployeeInfo added in v1.0.0

func UpdateEmployeeInfo(ctx context.Context, client *mongo.Client) error

UpdateEmployeeInfo is an example function demonstrating transactions.

func UpdateExamples

func UpdateExamples(t *testing.T, db *mongo.Database)

UpdateExamples contains examples of update operations.

func VersionedAPIDeprecationErrorsExample added in v1.6.0

func VersionedAPIDeprecationErrorsExample()

VersionedAPIDeprecationErrorsExample is an example of creating a client with versioned API with deprecation errors.

func VersionedAPIExample added in v1.6.0

func VersionedAPIExample()

VersionedAPIExample is an example of creating a client with versioned API.

func VersionedAPIExamples added in v1.6.0

func VersionedAPIExamples()

VersionedAPIExamples runs all versioned API examples.

func VersionedAPINonStrictExample added in v1.6.0

func VersionedAPINonStrictExample()

VersionedAPINonStrictExample is an example of creating a client with non-strict versioned API.

func VersionedAPIStrictExample added in v1.6.0

func VersionedAPIStrictExample()

VersionedAPIStrictExample is an example of creating a client with strict versioned API.

func WithTransactionExample added in v1.4.0

func WithTransactionExample()

WithTransactionExample is an example of using the Session.WithTransaction function.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL