Documents and MongoDB · Engineering

MongoDB wire compatibility: supported subset and gaps

What works with official MongoDB drivers, what the wire listener deliberately does not implement, and how to decide whether an existing application can move.

NonoDB is not MongoDB. It has its own HTTP/JSON API, its own storage engine, and a different concurrency model. It also ships an optional MongoDB-compatible wire listener so existing drivers can talk to it without a rewrite.

That listener is best understood as a documented subset, not a compatibility checkbox.

What is supported

The wire listener handles the parts most applications actually use:

Area Supported
Handshake hello, isMaster, ping, buildInfo
CRUD insert, find, getMore, killCursors, update, delete, findAndModify
Reads count, distinct, basic aggregate
Indexes createIndexes, listIndexes, dropIndexes
Collections create, drop, listCollections, listDatabases, dropDatabase
Auth SCRAM-SHA-256 / SHA-1, optional TLS
Drivers PyMongo, Node.js, and Go are in the tested matrix

A plain single-host URI such as mongodb://127.0.0.1:27017/ works. directConnection=true is optional; replica-set URIs are not supported. The listener can be unauthenticated on loopback, or require a username and password with SCRAM. Optional server TLS is configured with NONODB_MONGO_TLS_CERT and NONODB_MONGO_TLS_KEY.

ObjectIds are preserved as BSON ObjectIds on the wire. Driver-generated _id values behave as expected, including upserts that receive a new ObjectId.

What is missing

The gaps are deliberate and mostly follow from the single-writer, no-session design:

  • No sessions or causal consistency.
  • No multi-document transactions.
  • No retryable writes.
  • No change streams. Use outbox events, watch, or subscriptions.
  • No mongosh. Use the NonoDB CLI, GUI, or HTTP API.
  • No replica-set URIs or sharding.
  • No collation.
  • No wildcard or hidden indexes.
  • No server-side JavaScript, $where, or arbitrary operators outside the documented set.

Read concern is accepted for local and available; write concern is accepted at w:1. Other levels are rejected rather than silently ignored.

Text search is a subset

MongoDB-style text indexes can be created through createIndexes with a "text" key. A collection can have one text index, and that index covers exactly one field. Multi-field text keys and non-default weights are not supported.

The $text query is lexical and bounded: positive terms and quoted phrases must all match (AND), negative terms exclude, and at least one positive clause is required. That differs from MongoDB, which ORs positive text clauses. There is no stemming, stop-word removal, or non-none language support. The native BM25 API is the better choice when search is a first-class feature.

Text and filters still differ at the edges

Filters support the common operator set: equality, ranges, $in, $nin, $all, $size, $exists, $elemMatch, $regex with common options, $type, $mod, bitwise operators, $expr, and $jsonSchema with common keywords.

Unknown operators are rejected with code 2 instead of matching nothing. That is safer for a typo like $regx, but it means an application that relied on MongoDB’s permissive behavior may see new errors.

Projection, update operators, array filters, and pipeline updates cover the documented forms. Arbitrary computed projections and some newer aggregation operators are absent. The MongoDB compatibility page is the source of truth for the current matrix.

How to decide

Use the wire listener when:

  • the application uses PyMongo, Node.js, or Go;
  • CRUD, cursors, aggregation, index DDL, and basic text search are the core;
  • the team can replace sessions, transactions, and change streams with NonoDB primitives.

Do not use it when:

  • the application depends on multi-document transactions or causal sessions;
  • it uses MongoDB-specific collation or wildcard indexes;
  • it relies on Atlas Search, change streams, or mongosh administration;
  • it needs a multi-node cluster with automatic failover and sharding.

The useful test is not “does it connect?” It is “does the application exercise only the documented subset?”. Run the driver test suite, inspect the query shapes, and read the compatibility page before migrating. The next post covers the migration path itself.

All engineering notes →Read the docs