The document compatibility feature of PolarDB for PostgreSQL is highly compatible with document database syntax and drivers. Before you use this feature or migrate data, read this chapter carefully to understand the scope of compatibility, limits, and behavioral differences to ensure that your services run smoothly and stably.
Scope
Compatible versions: This feature is compatible with drivers and clients for MongoDB 4.0 and later. This feature does not support commands deprecated in versions earlier than MongoDB 4.0, such as
mapreduce. Upgrade your client or driver to a compatible version.Error codes: The document compatibility feature of PolarDB for PostgreSQL uses the same error names and codes as MongoDB. However, the specific error messages may differ.
Character sets: For the document compatibility feature of PolarDB for PostgreSQL, collection names must be valid UTF-8. MongoDB allows invalid UTF-8, but this feature does not.
Supported drivers and client tools
This feature supports official MongoDB drivers for most major programming languages and common client tools.
Official driver support
Language | Driver/Library |
Python |
|
Go |
|
JavaScript (Node.js) |
|
Java |
|
Rust |
|
C |
|
C++ |
|
PHP |
|
Ruby |
|
Scala |
|
Swift |
|
Client tool support
You can connect to and manage the database using standard MongoDB client tools.
mongosh
Studio 3T
Command compatibility matrix
The following tables show the support status for different types of MongoDB commands.
Aggregation commands
Command | Support status |
| |
| |
|
Query and write commands
Command | Support status |
| |
| |
| |
| |
| |
| |
|
O&M commands
Command | Support status |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Diagnostic commands
Command | Support status |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Session commands
Command | Support status |
| |
| |
| |
| |
| |
| |
| |
|
User management commands
Command | Support status |
| |
| |
| |
| |
| |
| |
|