mongo_pool 1.0.3 copy "mongo_pool: ^1.0.3" to clipboard
mongo_pool: ^1.0.3 copied to clipboard

A MongoDB connection pool for Dart. Using this package, your application will open as many database connections as you specify as soon as it runs.

example/mongo_pool_example.dart

import 'package:mongo_pool/mongo_pool.dart';

Future<void> main() async {
  /// Create a pool of 5 connections
  final pool = MongoDbPool(5, 'mongodb://localhost:27017/my_database');
  /// Open the pool
  await pool.open();
  /// Get a connection from pool
  final conn = await pool.acquire();

  // Database operations
  final collection = conn.collection('my_collection');
  final result = await collection.find().toList();
  // Connection release for other operations
  pool.release(conn);

  // Pool close
  await pool.close();
}
3
likes
0
pub points
52%
popularity

Publisher

verified publishermerterkoc.dev

A MongoDB connection pool for Dart. Using this package, your application will open as many database connections as you specify as soon as it runs.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

mongo_dart

More

Packages that depend on mongo_pool