SQL to NoSQL Converter
Converti schema SQL in collections MongoDB con embedding e reference strategies.
Come utilizzare SQL to NoSQL Converter
Attach the SQL template
Attach one or more instructions CREATE TABLE (PostgreSQL, MySQL or SQLite) to the editor, or click "Example" to load a test schema with relationships.
Choose your conversion strategy
Select Embed All, Reference All or Smart (Recommended) to determine how to handle foreign keys in the generated MongoDB schema.
Convert and read the result
Premi "Convert" and analyze generated collections with JSON Schema validation, required fields, and key indexes.
Copy or download the JSON
Copy MongoDB schema to notes or download as .json file ready for use as a collection validator.
Suggerimenti
- For schema with many relationships 1-N, Smart strategy avoids excessive duplication compared to Embed All.
- Check the tab "Mapping types" on your tab regularly to verify how uncommon SQL types are translated in your schema.
- Use "Example" to quickly understand how output changes between the three strategies before applying your real schema.
Domande frequenti
What's the difference between the three conversion strategies?
Embed All embeds all nested relationships as documents, Reference All converts all foreign keys to ObjectId references, Smart automatically chooses: embedding for 1-1 relationships and referencing for 1-N relationships.
Which SQL dialects are supported?
The parser recognizes generic table syntax compatible with PostgreSQL, MySQL, and SQLite: standardized columns, PRIMARY KEY, FOREIGN KEY, and NOT NULL constraints.
How are SQL types mapped to MongoDB BSON types?
With a fixed conversion table: for example, INT/BIGINT become Number/Long, DECIMAL becomes Decimal128, VARCHAR/TEXT become String, TIMESTAMP/DATE become Date, BLOB/BYTEA become BinData; unknown types become Mixed.
Do the generated indexes reflect my SQL schema keys?
Yes: an index is created on the primary key for each collection and, with strategies Reference All and Smart, an additional index for every column used as a foreign key reference.
Does the tool connect to a real database for execution?
No, it's a purely client-side tool: analyzes the attached SQL text and generates the MongoDB schema without any database connection or data sending to external servers.