---
title: "Migrating from the MongoDB Data API to Supabase"
description: "With MongoDB's Data API and HTTPS Endpoints reaching end-of-life on September 30, 2025, Supabase's auto-generated PostgREST API is offered as a near drop-in REST replacement."
url: "https://swe.quest/articles/migrating-from-the-mongodb-data-api-to-supabase-e9a02b6cce3743ea"
canonical: "https://supabase.com/blog/migrating-mongodb-data-api-with-supabase"
source: "Supabase"
published: "2025-03-20"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["postgres","schema-migrations","api-design","databases"]
---

# Migrating from the MongoDB Data API to Supabase

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2025-03-20, 5 min read, How-to. Original: [https://supabase.com/blog/migrating-mongodb-data-api-with-supabase](https://supabase.com/blog/migrating-mongodb-data-api-with-supabase)

## Summary

With MongoDB's Data API and HTTPS Endpoints reaching end-of-life on September 30, 2025, Supabase's auto-generated PostgREST API is offered as a near drop-in REST replacement. The migration path is to export collections with mongoexport, load documents into a Postgres table with a JSONB column via a supabase-js script, then normalize them into relational tables using Postgres JSON functions and LATERAL jsonb\_array\_elements. Client code then queries the generated REST endpoints, including embedded related rows. Tradeoffs include less schema flexibility than MongoDB, the need for document transformation scripts, and rethinking query patterns and indexes for relational joins.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)

## Prerequisites

- MongoDB basics
- SQL and relational schemas ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- Postgres JSONB ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

Supabase, MongoDB Data API, PostgREST, mongoexport, JSONB, supabase-js, MongoDB Atlas

## Related posts

- [Migrating from Fauna to Supabase](https://swe.quest/articles/migrating-from-fauna-to-supabase-eec2a4cdabcfd906.md): Supabase · 2025-03-21 · Medium · 6 min read · Schema migrations, PostgreSQL, Databases, JavaScript
  With Fauna sunsetting by the end of May 2025, a two-phase migration to Supabase keeps applications online.
- [Supabase CLI v1 and Management API Beta](https://swe.quest/articles/supabase-cli-v1-and-management-api-beta-40e0f641270aa760.md): Supabase · 2022-08-15 · Medium · 4 min read · Schema migrations, Developer tools, PostgreSQL, CI/CD, API design
  Supabase CLI v1 leaves beta with commands to manage organizations, projects and Edge Functions, plus database migration tooling, CI/CD workflows and TypeScript type generation.
- [NoSQL Postgres: Add MongoDB compatibility to your Supabase projects with FerretDB](https://swe.quest/articles/nosql-postgres-add-mongodb-compatibility-to-your-supabase-projects-with-ferretdb-44595afd7e1b96f1.md): Supabase · 2024-01-31 · Medium · 4 min read · PostgreSQL, Databases, Containers
  FerretDB, an open source MongoDB-compatible proxy, can run on top of a Supabase Postgres database, storing each collection as a table in a \`ferretdb\` schema with documents as JSONB rows.
- [Supabase CLI](https://swe.quest/articles/supabase-cli-a62c53c7dbec808f.md): Supabase · 2021-03-31 · Medium · 7 min read · Schema migrations, PostgreSQL, Developer tools
  Supabase's new CLI runs the full Supabase stack locally via Docker Compose, using the same tooling as production, and walks through wiring it to a React app.
- [Supabase Local Dev: migrations, branching, and observability](https://swe.quest/articles/supabase-local-dev-migrations-branching-and-observability-770def662fe57683.md): Supabase · 2023-08-08 · Easy · 6 min read · PostgreSQL, Developer tools, Schema migrations, Testing, Deployment
  Supabase's CLI gains a batch of Postgres local-development features: \`supabase inspect db\` with 19 diagnostic commands adapted from Heroku's pg-extras, \`db dump\` backups built on pg\_dump, migration squashing and diffing via migra, pgTAP testing with \`supabase test\`, plpgsql\_check linting, seeding, and TypeScript type generation that now detects foreign-key relationships.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
