DynamoDB to MongoDB Converter Online — Convert DynamoDB Operations to MongoDB Queries
Paste your AWS DynamoDB params above and get the equivalent MongoDB query instantly. Converts FilterExpression, typed attribute values, and all CRUD operations — everything runs in your browser.
How to Convert DynamoDB to MongoDB — Step-by-Step
Input Your DynamoDB Params
Migrating from DynamoDB to MongoDB? Paste the DynamoDB params JSON from your SDK code — the converter handles Scan, Query, PutItem, UpdateItem, and DeleteItem operations. The input expects the same JSON object you pass to the AWS DynamoDB SDK methods like documentClient.scan(params) or documentClient.put(params).
.json or .js fileExample: DynamoDB Scan Params
A typical Scan with FilterExpression, ExpressionAttributeNames, and typed ExpressionAttributeValues:
{ "TableName": "orders", "FilterExpression": "#status = :statusVal AND #total >= :minTotal", "ExpressionAttributeNames": { "#status": "status", "#total": "total_amount" }, "ExpressionAttributeValues": { ":statusVal": { "S": "completed" }, ":minTotal": { "N": "100" } }, "Limit": 20 }
Automatic Conversion to MongoDB
The converter maps DynamoDB concepts to their MongoDB equivalents. It parses FilterExpression syntax, resolves ExpressionAttributeNames (e.g., #status to status), and extracts DynamoDB typed values into plain MongoDB values:
=, <>, <, >, <=, >= become MongoDB $eq, $ne, $lt, $gt, $lte, $gtecontains() becomes $regex, begins_with() becomes $regex: "^prefix", attribute_exists() becomes $exists{"S": "v"} extracts to "v", {"N": "42"} to 42, {"BOOL": true} to trueAND combines conditions in the filter, OR becomes $or, NOT becomes $notfield BETWEEN :a AND :b becomes { field: { $gte: a, $lte: b } }Example: MongoDB find() Output
The Scan params from Step 1 convert to this MongoDB query:
db.orders.find( { "status": "completed", "total_amount": { "$gte": 100 } } ).limit(20)
CRUD Operation Mapping
Beyond read queries, the converter handles all DynamoDB write operations. PutItem becomes insertOne(), UpdateItem with UpdateExpression becomes updateOne() with $set/$unset/$inc, and DeleteItem becomes deleteOne(). Typed attribute values are unwrapped automatically in every case.
Item object is unwrapped from DynamoDB types and passed to insertOne()SET #name = :val becomes { $set: { "name": val } }REMOVE #field becomes { $unset: { "field": "" } }ADD #counter :val (numeric) becomes { $inc: { "counter": val } }Key is unwrapped and passed as the filter to deleteOne()Example: DynamoDB PutItem Input
A PutItem operation with typed attribute values:
{ "TableName": "users", "Item": { "userId": { "S": "u-1001" }, "name": { "S": "Alice Johnson" }, "age": { "N": "30" }, "active": { "BOOL": true } } }
Example: MongoDB insertOne() Output
Typed values are extracted and the document is ready for MongoDB:
db.users.insertOne( { "userId": "u-1001", "name": "Alice Johnson", "age": 30, "active": true } )
Copy or Download Your MongoDB Query
.js file for version control or team sharingFrequently Asked Questions — DynamoDB to MongoDB
How do I convert DynamoDB to MongoDB online?
Paste your DynamoDB params JSON into the input editor and the converter generates the equivalent MongoDB query instantly. It handles Scan/Query (to find()), PutItem (to insertOne()), UpdateItem (to updateOne()), and DeleteItem (to deleteOne()). DynamoDB typed attribute values like {"S": "value"} and {"N": "42"} are automatically extracted into plain MongoDB values. No account or login needed — just paste and convert.
What DynamoDB functions does it convert?
contains(field, value) becomes MongoDB { field: { $regex: "value" } }. begins_with(field, prefix) becomes { field: { $regex: "^prefix" } }. attribute_exists(field) becomes { field: { $exists: true } } and attribute_not_exists() becomes { field: { $exists: false } }. The BETWEEN operator maps to { $gte: low, $lte: high }, and IN maps to $in. All standard comparison operators (=, <>, <, >, <=, >=) are converted to their MongoDB equivalents.
Does it handle UpdateItem with UpdateExpression?
Yes. The converter parses the full UpdateExpression syntax and maps each action to the appropriate MongoDB update operator. SET #name = :val becomes { $set: { "name": value } }. REMOVE #field becomes { $unset: { "field": "" } }. ADD #counter :incr on a numeric attribute becomes { $inc: { "counter": value } }, and ADD #tags :newTags on a set attribute becomes { $addToSet: { "tags": { $each: [...] } } }. Multiple actions in a single UpdateExpression are combined into one updateOne() call.
How are DynamoDB typed values handled?
DynamoDB stores every value with a type descriptor: {"S": "text"} for strings, {"N": "42"} for numbers (stored as strings in DynamoDB), {"BOOL": true} for booleans, {"NULL": true} for null values, {"L": [...]} for lists, and {"M": {...}} for maps. The converter extracts the underlying values automatically — {"N": "42"} becomes the number 42, nested maps and lists are recursively unwrapped, and set types (SS, NS, BS) become plain arrays.
Why migrate from DynamoDB to MongoDB?
Common reasons include needing more flexible querying — MongoDB supports ad-hoc queries on any field, JOINs via $lookup, and a rich aggregation pipeline. Teams also migrate to reduce vendor lock-in with AWS, gain a more expressive document model with nested queries, simplify local development (MongoDB runs easily on any machine), or move to a self-hosted or MongoDB Atlas setup for better cost control at scale.
Is my data safe?
Completely safe. Your DynamoDB params are processed entirely in your browser using client-side JavaScript. Nothing is transmitted to any server, no data is stored or logged, and no cookies are used for tracking your input. You can verify this by checking your browser's network tab — zero requests are made during conversion.
Is this converter free?
Yes, 100% free with no limits on usage, no account required, and no rate limiting. Use it as many times as you need for your DynamoDB to MongoDB migration. Also check out: SQL to MongoDB, MongoDB to SQL, SQL to DynamoDB, DynamoDB to SQL, and DynamoDB Query Formatter.
Related Tools
SQL to MongoDB
Convert SQL queries to MongoDB query syntax with aggregation pipeline support
MongoDB to SQL
Convert MongoDB queries and aggregation pipelines to equivalent SQL statements
SQL to DynamoDB
Convert SQL queries to AWS DynamoDB query and scan operations with PartiQL support
DynamoDB to SQL
Convert AWS DynamoDB query and scan operations to equivalent SQL statements
MongoDB Query Formatter
Format, beautify, and validate MongoDB queries with proper indentation and syntax highlighting
MongoDB to DynamoDB
Convert MongoDB queries to AWS DynamoDB query operations and vice versa