Skip to content
pubscout

mongo_dart

0.10.10, released 6 weeks ago by an unverified publisher

MongoDB driver implemented in pure Dart for server-side applications.

Unverified publisher
$ flutter pub add mongo_dart
Source repository

What it does

Provides a server-side MongoDB driver written in pure Dart. It supports all CRUD operations, aggregation pipelines, authentication methods, and secure TLS/SSL connections.

AI-written summary of version 0.10.10, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a Dart or Flutter server-side application that needs to connect to MongoDB.
  • You require full CRUD operations, aggregation pipelines, and change streams in pure Dart.

Skip it when

  • You need client-side database storage inside a mobile app (use local NoSQL/SQL solutions instead).
  • You are relying on deprecated legacy commands for very old MongoDB versions without migration.

Strengths

  • Implemented in pure Dart with no external native dependencies.
  • Supports modern MongoDB protocol operations (OP_MSG), bulk writes, and aggregation pipelines.
  • Compatible with cloud services like MongoDB Atlas and Azure DocumentDB.

Weaknesses

  • Not suitable for client-side mobile storage directly due to server-side architectural design.
  • Porting of all modern MongoDB commands is still a work in progress.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
13

Add mongo_dart to your dependencies and initialize a Db connection string.

var db = Db("mongodb://localhost:27017/mongo_dart-blog");
await db.open();
var coll = db.collection('find');
await collection.find(where.eq('name', 'Tom').gt('rating', 10)).toList();

Alternatives

Packages that do the same job and could replace mongo_dart.

  • ioredis

    Redis client for Dart with connection pooling, pub/sub, transactions, and pipelining.

  • local_shared

    Lightweight cross-platform secure local JSON storage for collections and documents.

Works with

Packages commonly used together with mongo_dart: ones it builds on, ones built on it, and its own family.