MongoDB to BigQuery connector, CDC and Dataflow options compared, and what actually lands in the table
Ten ways to get MongoDB collections into BigQuery. Most of them, left on defaults, land each document as one JSON value and leave the typing to your analysts, and one of Google's own defaults changed on 16 September 2026. We read every vendor's documentation on 26 September 2026 and put what lands side by side.
The live demo needs no card, and Starter is $49 a month.
Field mapping auto-plugged · tap a port to rewire
Plug a source port into
Transform on this cable
JSON in
JSON out
5 sample records ready
Vendor documentation read 26 September 2026
Which MongoDB to BigQuery connector should you use?
Choose by what has to land in BigQuery. If a JSON copy that your analysts unwrap in SQL is enough, Google Datastream is the first-party answer: it has replicated MongoDB change streams into BigQuery since September 2025. If you only need a one-off or nightly copy, the Dataflow batch template does it. If your reports need typed columns for nested fields, and most finance and product reports do, none of the defaults give you that. You either write and maintain the typed views yourself, or use a mapped sync that lands the declared paths as typed columns from the first load.
For the rest of the warehouse, the other sources and loaders are compared on BigQuery ETL tools, and if MongoDB is going to PostgreSQL instead, the same "what lands" question is answered on MongoDB to PostgreSQL migration tools.
Eight defaults, read from each vendor's own documentation
MongoDB never enforced a shape on your documents and BigQuery wants one for everything it can prune, cluster or aggregate cheaply. Every connector has to decide how to bridge that, and the setup wizard rarely tells you what it decided. The documentation does. The last column is what we would ship.
| Tool and setting | What its documentation says | Why it matters to a buyer | What we would ship |
|---|---|---|---|
| Dataflow batch template, default | With userOption NONE, the table gets three columns: id, source_data and timestamp. Google states that source_data "contains the entire document as JSON", and the column type is STRING. | Every query parses a string. There is no type on anything, and no way to cluster on a field that lives inside it. | Use JSON mode at minimum, then project typed columns |
| Dataflow batch template, FLATTEN | Google's template docs describe FLATTEN as flattening "the documents to the single level", with top-level fields becoming table columns. | Only the top level becomes columns. customer.email and totals.grand_total stay nested, which is where most reporting fields live in a real document. | Declare nested paths explicitly |
| Dataflow CDC template | Google: "publish the change stream data to Pub/Sub. The pipeline reads the JSON records from Pub/Sub." The same page states it "doesn't support BigQuery change data capture". | The part that reads MongoDB is yours to build and run. And each change arrives as a new row, so a document updated forty times appears forty times until you deduplicate. | Merge on _id, keep history separately |
| Datastream, canonical mode | Canonical mode "ensures that every BSON type is explicitly labeled". A date is written as {"$date":{"$numberLong":"..."}}. Google's release notes date this default for new streams to 16 September 2026. | Nothing is lost, which is the point. But every date, long and decimal is a wrapper you unwrap in SQL, and streams created before 16 September wrote a different shape. | Typed view that handles both shapes |
| Datastream, strict mode | Google: "Strict mode doesn't support the Infinity, -Infinity, and NaN numeric values. Documents are discarded if they contain these values in strict mode." | A document with one NaN in one field does not arrive at all. The stream stays healthy, and the row count is simply lower than the collection count. | Scan for NaN before choosing strict |
| Airbyte, default mode | The MongoDB v2 source "enforces a schema" inferred from a sample, "Default is 10,000" documents, and records with structural mismatches "would be written as NULL". | A field the sample missed never becomes a column, and a value of the wrong shape becomes NULL. Both happen with every sync reporting success. | Inventory every field, not a sample |
| Airbyte, schemaless mode | Each record carries only "_id" and "data", and Airbyte notes that "no field will be omitted and no document will be rejected." In BigQuery, data lands as the native JSON type. | Complete and untyped. The same outcome as Datastream, with the modeling left to your analysts. | Fine as a raw layer, not as the model |
| Fivetran, default mode | Packed mode is "the default mode", writing data "without unpacking nested fields". In unpacked mode, "We only unpack one layer of nested fields and infer types." | The same payload landing as the others by default. Turning unpacking on gets you one layer, and anything deeper remains JSON. | Decide depth per path, not per connector |
The row most teams will trip on this quarter is Datastream's. Canonical mode became the default for new streams on 16 September 2026, so an organization that created one stream in the summer and another this month now has two tables where the same date field sits at two different JSON paths. The SQL that unwraps both shapes, type by type, is in our guide to converting MongoDB Extended JSON into typed BigQuery columns. The Snowflake version of this route, where the first-party connector also lands a payload, is on MongoDB to Snowflake migration tools.
BSON types in BigQuery, and the wrong target a default picks
A MongoDB to BigQuery connector is mostly a type converter with Extended JSON in the middle. The second column is how the type travels. The last is the mistake we see most, and none of them raise an error.
| BSON type | In Extended JSON | Right BigQuery target | Common wrong target |
|---|---|---|---|
| ObjectId | {"$oid": "..."} in every mode | STRING with the 24 hex characters | Leaving the $oid wrapper, so joins compare JSON objects |
| Date | Canonical: $date with $numberLong. Strict: $date as a number | TIMESTAMP, from UTC milliseconds | STRING, or DATETIME without a zone |
| Int64 (long) | {"$numberLong": "..."} as a string | INT64, cast from the string | FLOAT64 via a JSON number, past 2^53 |
| Decimal128 | {"$numberDecimal": "..."} as a string | NUMERIC, or BIGNUMERIC past 9 decimals | FLOAT64, which rounds currency |
| Double with NaN | Canonical: {"$numberDouble": "NaN"} | FLOAT64, which accepts NaN | Strict mode, which drops the document |
| Embedded document | A JSON object | Typed columns for used paths, JSON for the rest | FLATTEN, which stops at the top level |
| Array of subdocuments | A JSON array | ARRAY of STRUCT, or a child table with position | A JSON string nobody can UNNEST cheaply |
| Field with mixed types | Number in old documents, string in new | JSON kept, plus a view that casts deliberately | A typed column that turns mismatches into NULL |
| Missing field vs null | Absent key vs an explicit null | A nullable column, JSON kept to tell them apart | Collapsing both into NULL |
One BigQuery rule changes the economics of the whole decision. The JSON type cannot be used to partition or cluster a table, because equality and comparison are not defined on it. A dashboard that filters orders by a status that lives inside JSON reads the whole table every time it refreshes. Promote the handful of fields you filter and join on into typed columns, and keep JSON for everything else. How BigQuery loads behave in general, including the Storage Write API, is covered in how to load data into BigQuery.
The six mechanisms behind "MongoDB to BigQuery"
Two of them are Google's own, which is unusual for a warehouse route and changes the buying question. You are rarely choosing whether a connector exists. You are choosing who writes the typed layer.
| Mechanism | Owner | How it moves data | Who it is for | What to watch |
|---|---|---|---|---|
| Datastream | Google Cloud | Backfill plus continuous CDC from change streams, merged or append-only, as Extended JSON. | GCP shops that want a first-party, serverless stream. | Payload landing. Canonical and strict shapes differ. |
| Dataflow templates | Google Cloud | A batch template per collection, and a streaming template that reads change events you publish to Pub/Sub. | Teams already running Dataflow who want a copy, not a model. | Batch is Beta. CDC needs your own publisher. |
| Managed ELT | Fivetran, Airbyte, Estuary, Hevo | Reads change streams and writes to BigQuery on a schedule or continuously. | Teams that want zero pipeline operations. | Packed JSON or sampled schemas. Metered bills. |
| Open source CDC | You, on Debezium and Kafka Connect | Streams change events through Kafka into a BigQuery sink after a flattening transform. | Organizations already standardized on Kafka. | No license fee, real operational load. |
| Dump and load | You, on mongoexport and bq load | Exports collections to newline-delimited JSON, loads a staging table, reshapes with SQL. | One analysis on a few small collections. | Point in time only. No deletes, no updates. |
| Mapped sync (Adapters) | Adapters | You declare document paths once, we land typed columns and arrays as child tables, then sync incrementally. | Teams who want typed BigQuery tables on a flat bill. | Not a sub-second streaming platform. |
Whichever mechanism you choose, the change feed underneath is the same MongoDB change stream. How it compares with log-based capture on relational databases, and what each source needs switched on, is on change data capture tools.
MongoDB to BigQuery connectors and CDC tools compared
Billing units rather than price tags, except where the vendor publishes the number itself: Fivetran's $5 base charge per connection and Estuary's $0.50 per GB were read from their own pricing pages in September 2026. Every other line depends on your volumes, so we state the unit and leave the arithmetic to a quote. Where a tool is wrong for a job, the last column says so, including for us.
| Tool | Approach | Best for | Billing unit | What to watch |
|---|---|---|---|---|
| Google Datastream | Serverless CDC, merge or append-only | GCP teams wanting first-party replication | Data processed, plus BigQuery merge compute | Lands Extended JSON; you write the typed layer |
| Dataflow batch template | One collection to one table, NONE, FLATTEN or JSON | A one-off or nightly full copy | Dataflow worker time | Beta; FLATTEN is top level only |
| Dataflow CDC template | Pub/Sub JSON into BigQuery, streaming | Teams already publishing change events | Dataflow worker time plus Pub/Sub | You build the change stream reader |
| Fivetran | Managed connector, packed or one-layer unpacked | Teams who want no pipeline operations | Monthly active rows, plus $5 base per connection | Packed JSON by default |
| Airbyte | Change stream source, schema enforced or schemaless | Teams who want open source they can patch | Free self-hosted, credits on cloud | Mismatches written as NULL by default |
| Estuary | Streaming capture from change streams | Low latency with an easy setup | $0.50 per GB moved plus connector instances | Batch mode on standalone servers is not CDC |
| Hevo | Managed pipeline with automatic flattening | Smaller teams wanting a UI first | Plans by event volume | Ask how deep flattening goes |
| Debezium plus BigQuery sink | Change streams to Kafka to BigQuery | Organizations already running Kafka | Infrastructure and engineering time | Arrays and flattening are your decisions |
| mongoexport plus bq load | Export to JSON lines, load, reshape | One analysis on small collections | Free apart from BigQuery storage and queries | Relaxed JSON by default; no change capture |
| Adapters | Mapped sync of declared paths to typed columns | Typed reporting tables on a flat bill | Flat monthly plan from $49 | Not built for sub-second latency |
Datastream's own bill is only half of it. Google's destination documentation notes that BigQuery change data capture operations run on on-demand pricing by default, recommends a slot reservation for predictable cost, and exposes a max_staleness setting to trade freshness against merge cost. Ask for that line in any estimate. For how the managed vendors price themselves across every source, see the best data integration tools and Fivetran against Airbyte on cost.
Six numbers worth knowing before you sign anything
16 Sep 2026
The date Datastream made canonical Extended JSON the default for new MongoDB to BigQuery streams. Older streams may still write the strict shape.
Datastream release notes, read 26 Sep 2026
> 5.0
The MongoDB versions Datastream supports. It reads change streams, which exist only on replica sets and sharded clusters.
Datastream MongoDB source docs, read 26 Sep 2026
20 MB
The maximum event size Datastream writes into BigQuery. Extended JSON is wordier than BSON, so size the largest documents against it.
Datastream BigQuery destination docs, read 26 Sep 2026
3 columns
What the Dataflow batch template writes by default: id, source_data holding the whole document as a string, and timestamp.
Dataflow MongoDB to BigQuery template, read 26 Sep 2026
10,000
Airbyte's default sample for inferring a MongoDB schema. Values that do not fit the inferred shape are written as NULL.
Airbyte MongoDB v2 docs, read 24 Sep 2026
0
JSON columns you can partition or cluster a BigQuery table on. Filters on fields inside JSON cannot prune storage.
BigQuery JSON data docs, read 26 Sep 2026
Eight ways this pipeline goes wrong while every check stays green
Pipelines into BigQuery are built to keep going, and that is usually right. It also means the failures below never page anyone. We would check all eight before trusting a number from a new MongoDB feed.
| The failure | What you see | What is actually happening |
|---|---|---|
| Two JSON shapes in one table | Old dashboards still work | A stream created before 16 September 2026 writes strict dates as a number, a new one writes canonical dates as a nested $numberLong string. SQL written for one shape returns NULL on the other, silently. |
| Documents discarded for NaN | Stream healthy, no errors | In strict mode Datastream discards any document holding NaN or Infinity. The collection count and the table count drift apart and nothing alerts. |
| The field the sample never saw | Sync green, counts match | Schema inference read 10,000 documents. A field that only appears later never became a column, even though every document was copied. |
| Mismatches written as NULL | Rows load, totals look low | A price stored as a string in old documents and a number in new ones becomes NULL wherever it does not fit the inferred type. |
| Forty rows for one order | Revenue is inflated | The Dataflow CDC template and append-only streams add a row per change. Without a view that keeps the latest row per _id, sums count every update. |
| FLATTEN stopped at the top | The table has columns | Only top-level fields became columns. The nested fields that reports need are still inside a JSON value or string. |
| Decimals through FLOAT64 | Totals off by cents | Decimal128 extracted as a JSON number and read as FLOAT64 rounds. Extract the $numberDecimal string and cast it to NUMERIC instead. |
| The oplog gap after an outage | Stream resumes and carries on | Change streams resume from a position in the oplog. If the pipeline was down longer than the oplog window, those changes are gone unless you reconcile. |
Five of the eight come from a shape that was guessed or inherited instead of declared. The guard is the same for all of them: a field inventory before the first load and a reconciliation of counts and NULLs after it. The one-time version of this problem, where you leave MongoDB entirely, is covered by data migration tools.
Six steps that decide whether the BigQuery tables are usable
Step 1
Inventory every field, not a sample
Run an aggregation over each full collection that lists every field path, how often it appears and which BSON types it holds. It replaces the sampling guess and tells you which fields deserve typed columns in BigQuery and which can stay in JSON.
Step 2
Confirm change streams are available
Every CDC route on this page needs a replica set or sharded cluster, and Datastream needs a MongoDB version later than 5.0. A standalone mongod rules out continuous replication until it is converted, so find this out in week one.
Step 3
Choose the landing shape per collection
Raw JSON for fast-changing collections, typed columns for the fields finance and product reports use, child tables for arrays of line items. Write the decision down. It is the part no connector makes for you.
Step 4
Pin the JSON format
If you use Datastream, set canonical or strict explicitly rather than inheriting a default that changed on 16 September 2026. Scan for NaN and Infinity first if you are tempted by strict mode.
Step 5
Backfill, then stream
Load history once, then follow the change stream. Decide early whether BigQuery should hold the current state of each document, the full change history, or both, because merge and append-only are set per stream.
Step 6
Reconcile counts and NULLs
Compare document counts per collection with distinct _id counts per table, and field presence in MongoDB with non-NULL counts in each column. This is the only check that catches discarded documents and mismatches written as NULL.
Why US teams pay to connect MongoDB to BigQuery
Product analytics on app data
The application runs on MongoDB Atlas and the analytics team works in BigQuery and Looker. They need orders, users and events joined, fresh within minutes, without querying production.
Finance reporting from a document store
Revenue, refunds and subscriptions live in nested documents. Finance needs them as typed NUMERIC columns that tie out to the ledger, not as strings parsed on every query.
Joining MongoDB with SaaS data
Customer records in MongoDB need to meet Salesforce, HubSpot and Stripe data already in BigQuery. The join keys have to be clean strings, not $oid wrappers.
Retiring a nightly export script
A cron job runs mongoexport and bq load every night and fails quietly once a month. The team wants change capture, retries and alerts instead of a script nobody owns.
Machine learning features
Data scientists want BigQuery ML or Vertex AI over behavioral data that lives in MongoDB. They need consistent types across years of documents written by different app versions.
Audit and retention
Compliance wants the full change history of certain collections kept for years. An append-only stream into BigQuery, with a current-state view on top, gives them both.
Five jobs where you should not pick us
A comparison page that never says the competition wins is an advert. These are the cases where something else on this page is the better buy.
- You are a GCP shop and a JSON landing is genuinely enough for your analysts. Datastream is first-party, serverless and already in your console, and it bills by the data it processes. Use it and write the views.
- You need a one-off copy of a few collections for a single analysis. The Dataflow batch template in JSON mode, or mongoexport and bq load, will do it for very little.
- You already run Kafka and Debezium. Adding a BigQuery sink to a pipeline you operate today costs less than adding a vendor.
- You need sub-second latency from a MongoDB write to a BigQuery row. Streaming platforms built for that will beat our incremental sync.
- Your collections change shape weekly and nobody can say which fields matter yet. Land raw JSON first with any tool here and come back to typed columns once the reports settle.
Four questions to ask any vendor on this list
Question 01
What exactly lands in the BigQuery table?
Ask for the DDL of one real collection after a test sync. A three-column payload table, top-level columns only, a schema from a sample, or typed nested paths are all possible answers, and they lead to very different query bills.
Question 02
How are updates and deletes represented?
Merged into the current row, appended as a history row, or a soft-delete flag. Each is fine if you know which one you have. The expensive surprise is summing an append-only table as if it held current state.
Question 03
What happens to a value that does not match the column type?
An error you can see, a NULL you cannot, or the value kept in JSON beside the typed column. Two well-known tools on this page write NULL by default and say so in their own documentation.
Question 04
What do you need from our MongoDB deployment?
Change capture needs a replica set or sharded cluster, a supported version, network access from the vendor or from Google, and read roles. Any of these can add infrastructure work before a single document moves.
Related BigQuery and MongoDB guides
The typed-column guide for this route, the other MongoDB destinations, and the BigQuery pages for the rest of your sources.
Convert MongoDB Extended JSON to BigQuery columns
The SQL for every BSON wrapper, in both Datastream shapes, and the check that finds mixed tables.
BigQuery ETL tools
Every way to load BigQuery from databases and SaaS apps, and what each bills by.
MongoDB to Snowflake migration tools
The Snowflake version of this route, where the first-party connector lands two columns.
MongoDB to PostgreSQL migration tools
Typed tables or JSONB in Postgres, with the defaults that skip fields.
Postgres to BigQuery connector
The relational route into the same warehouse, with incremental loads.
Change data capture tools
Change streams against binlogs and logical replication, and what each source needs.
Questions buyers ask about MongoDB to BigQuery
- How do I transfer data from MongoDB to BigQuery?
- Pick a mechanism by what must land. Google Datastream replicates MongoDB into BigQuery continuously as JSON. The Dataflow MongoDB to BigQuery template runs a batch copy. Managed pipelines such as Fivetran and Airbyte sync on a schedule. A mapped sync lands typed columns. Then decide which fields become columns before the first load, not after.
- Is there a MongoDB BigQuery connector?
- Yes, several. Google offers two first-party routes: Datastream, which has supported MongoDB as a source since September 2025, and two Dataflow templates, one batch and one for change data. Fivetran, Airbyte, Estuary and Hevo sell managed connectors. They differ mostly in what lands: a JSON payload, top-level columns, or a schema inferred from a sample.
- Can Datastream replicate MongoDB to BigQuery?
- Yes. Datastream support for MongoDB as a source became generally available on 23 September 2025. It reads change streams, so it needs a replica set or sharded cluster, and Google documents support for MongoDB versions later than 5.0, including Atlas and self-managed servers. Documents arrive in BigQuery as Extended JSON, in canonical mode by default.
- How does MongoDB to BigQuery CDC work?
- A connector tails MongoDB change streams, the ordered feed of inserts, updates and deletes, and applies each event to BigQuery, either merged into the current row or appended as history. Change streams exist only on replica sets and sharded clusters. Google's Dataflow CDC template does not read them itself: you publish the events to Pub/Sub first.
- What is the MongoDB to BigQuery Dataflow template?
- It is a Google-provided batch pipeline that reads one collection and writes it to one BigQuery table. Its default, userOption NONE, writes three columns: id, the whole document as a JSON string in source_data, and a timestamp. FLATTEN promotes top-level fields to columns and JSON uses the native JSON type. Google lists it as Beta.
- Can Airbyte sync MongoDB to BigQuery?
- Yes. Airbyte reads MongoDB change streams and writes to BigQuery, where nested objects arrive in the native JSON type. By default it infers the schema from a sample of 10,000 documents, and its documentation says records with structural mismatches are written as NULL. Schemaless mode lands only _id and data instead, which keeps everything but types nothing.
- Can Fivetran sync MongoDB to BigQuery?
- Yes. Fivetran's MongoDB connector writes to BigQuery in packed mode by default, which keeps each document as JSON in a data column. Unpacked mode exists, but Fivetran states it unpacks only one layer of nested fields. Billing is by monthly active rows, plus a $5 base charge per connection that we read on Fivetran's pricing page.
- Should MongoDB documents land in BigQuery as JSON or as columns?
- Both, for most teams. Keep the raw document in a JSON column so nothing is ever lost, and project the fields your reports actually use into typed columns. BigQuery cannot partition or cluster a table on a JSON column, so a report that filters on a field buried in JSON scans more data than one that filters on a typed column.
- How much does it cost to move MongoDB to BigQuery?
- The pipeline bill is usually the smaller line. Datastream bills by the data it processes, Dataflow by worker time, Fivetran by monthly active rows plus a $5 base per connection, and Estuary by data moved plus connector instances. The larger cost is BigQuery compute spent unwrapping JSON on every query, which typed columns avoid.
For the relational sources feeding the same warehouse, see replicating MySQL tables into BigQuery, and for the field-by-field SQL on this route read how to turn MongoDB Extended JSON into typed BigQuery columns.
Land MongoDB documents in BigQuery as typed columns
Declare the document paths that matter, send arrays to child tables, run the backfill, then let the same mapping sync incrementally with retries, alerts and per-record logs. From $49 a month, not metered by rows.
The live demo needs no card, and Starter is $49 a month.