Dataset
MongoDB document collection datasets for AI training
A MongoDB dataset is a dump of chosen collections from a business's MongoDB deployment: the BSON documents behind its application, such as user profiles, orders, content items and event records, with their embedded sub-documents, indexes, schema validation rules, view definitions and any files stored in GridFS. SourceX sources it to a buyer's spec from established businesses that run MongoDB, self-managed or on Atlas. Each dataset is de-identified and licensed for an agreed permitted use. Check that the review reached values nested inside sub-documents and arrays.
Dataset manifest
Sourced to your spec- What it is
- Chosen collections from one MongoDB deployment as BSON documents, with index definitions, validation rules, view definitions and GridFS files
- Typical systems
- MongoDB Community or Enterprise Server, or MongoDB Atlas, with time series collections and GridFS buckets where the application used them
- Typical history
- The current state of each document; earlier values only where the application kept them. Ask for the earliest ObjectId time per collection
- Modality
- Nested documents with typed values, free text inside them, and binary files in GridFS
- Delivery formats
- Agreed per order; mongodump BSON with its metadata files, or canonical Extended JSON as JSONL, with a field-path and type profile per collection
- Preparation
- Personal values and secrets removed or replaced by field path, sub-documents and arrays included; _id values re-keyed consistently so references still resolve
- Licensing
- Scoped per database, collection and date range; permitted use agreed per license; MongoDB, Inc.'s terms for the server edition or Atlas checked by owner and buyer
- Availability
- Sourced to your spec; collections, history and document shapes depend on the business's application, and supply is not guaranteed
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| namespace | string | The database and collection the document came from, written database.collection as MongoDB names a namespace. |
| document_id | string | The document's _id, usually an ObjectId, re-keyed consistently so references from other collections still match. |
| id_timestamp | datetime | The creation time encoded in an ObjectId _id, kept when the _id itself is re-keyed. |
| document | object | The document body in canonical Extended JSON, with embedded documents and arrays at their original depth. |
| bson_types | object | The BSON type at each field path of this document, such as objectId, date, decimal, long or binData. |
| shape_id | string | A label for this document's set of field paths and types, grouping the shapes one collection holds. |
| references | array | Field paths that hold another document's _id, with the target collection and whether the owner stated it. |
| validator | object | The collection's $jsonSchema or query-expression validator with its validationLevel and validationAction, from the collection options. |
| indexes | array | Index definitions from the dump's metadata file: key pattern, unique, sparse, partial filter expression, TTL setting and collation. |
| view_definition | object | For a view, the source collection and aggregation pipeline that define it, since a view stores no documents. |
| gridfs_file | object | An fs.files document with length, chunkSize, uploadDate, filename and metadata, linked to its fs.chunks by files_id. |
| redactions | array | Field paths in this document where a value was removed or replaced during de-identification. |
Field names from the table above; values are masked placeholders.
Example record
{
"namespace": "storefront.orders",
"document_id": "64f1c2609b3e4d7a1c0e5521",
"id_timestamp": "2023-09-01T10:52:16Z",
"shape_id": "orders.shape_3",
"document": {
"_id": {
"$oid": "64f1c2609b3e4d7a1c0e5521"
},
"customerId": {
"$oid": "61a8e0f44c2b9a0d3f7712ab"
},
"status": "shipped",
"placedAt": {
"$date": {
"$numberLong": "1693565536000"
}
},
"items": [
{
"sku": "LMP-220-BRS",
"qty": {
"$numberInt": "2"
},
"unitPrice": {
"$numberDecimal": "48.50"
}
}
],
"shippingAddress": {
"city": "[CITY]",
"region": "OH",
"postalCode": "[REDACTED]"
},
"total": {
"$numberDecimal": "97.00"
},
"notes": "Leave at the side door. Called [NAME] to confirm.",
"schemaVersion": {
"$numberInt": "3"
}
},
"bson_types": {
"customerId": "objectId",
"placedAt": "date",
"items.unitPrice": "decimal"
},
"references": [
{
"path": "customerId",
"target": "storefront.customers",
"basis": "owner-stated"
}
],
"redactions": [
"shippingAddress.city",
"shippingAddress.postalCode",
"notes"
]
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Teach agents to query nested documents
Collections with arrays of sub-documents are practice ground for dot-notation filters and aggregation pipelines that use $unwind and $lookup.
Infer schemas from mixed shapes
One collection holding several document shapes is the task itself: find the versions, map old fields to new and write the migration.
Map documents to tables
Embedded line items and addresses are material for flattening documents into rows and back without losing array order or types.
Detect and repair type drift
A field that is a string in one document and a date in the next gives a model real drift to find and fix.
Evaluate data agents on an application back end
Questions the owner answers from the collections, with known results, test whether an agent follows undeclared references.
Use-case guides: Coding agents, Enterprise and computer-use agents, Private evaluation sets
What makes this data valuable
Types preserved
BSON or canonical Extended JSON keeps ObjectId, date, Decimal128, long and binary values distinct from strings and plain numbers.
Shape profile per collection
A count of documents per set of field paths and types shows how many application versions left their mark.
References documented
A map of which fields point to which collections stands in for the foreign keys MongoDB never declared.
Validators and indexes included
Validation rules and index definitions are the only structure the database itself states.
Redactions listed by path
A log by full field path shows the review reached arrays and sub-documents, not only top-level keys.
Dump method stated
Server version, topology and the exact dump command explain what the files can contain.
Document stack
MongoDB dataset
One collection holds several shapes, and no reference is declared
MongoDB stores whatever the application wrote. Unless someone attached a validator to a collection, the server accepts any document, so a collection is a layered record of every version of the code that ever wrote to it. The oldest user documents have one name string, later ones firstName and lastName. A price is a double in old orders and a Decimal128 in new ones. Many teams upgrade a document only the next time it is saved, so records nobody touched keep the old shape for good. A field can be absent, null or an empty string, three different states. Where a validator does exist, it was often added late. MongoDB checks it on inserts and updates, not against documents already stored, and it can be set to warn without rejecting.
Relationships take two forms, and neither is declared. The first is embedding: line items inside the order, a shipping address copied in at checkout. An embedded copy is a snapshot. It does not change when the customer later edits their profile, so documents preserve point-in-time values a normalized database would have overwritten, and one fact appears in many documents with different values. The second form is a reference: a field holding another document's _id, sometimes as an ObjectId and sometimes as its string form. There is no foreign key and no cascade, so references to deleted documents are ordinary, and a join happens only when a query asks for one with $lookup. The field name is usually the only hint of the target.
An update replaces the stored values and the server keeps no earlier version. The history that exists is what the application put there: the creation time inside each ObjectId, createdAt and updatedAt fields, soft-delete flags, and arrays the code appended to, such as a status history. Collections with a TTL index delete their own documents after a set age, and capped collections overwrite their oldest entries, so session and event collections may hold only a recent window.
What mongodump keeps, what mongoexport changes, and what the oplog is
mongodump writes two files per collection: a .bson file of the documents and a metadata file with the collection options, including any validator, and the index definitions. Every BSON type survives: ObjectId, dates, Decimal128, 32-bit and 64-bit integers kept apart from doubles, and binary values with their subtype. Views are dumped as definitions, not documents. Two things to ask about. A dump taken while the application was writing is not one moment in time, so a reference can point at a document created after its collection was read. mongodump's oplog option corrects that only for a full dump of a replica set member, not for one limited to chosen databases or collections. And binary UUIDs written with the older subtype were stored in a byte order that differed between drivers.
mongoexport writes JSON or CSV and no metadata. Its default JSON is relaxed Extended JSON, where 32-bit and 64-bit integers are written as the same bare number and a double loses its wrapper too, so the stored type has to be guessed. Canonical Extended JSON wraps each value in its type. CSV is worse for mixed-shape collections: the caller must name the fields, any field not named is silently absent, and nested arrays and sub-documents arrive as strings. Files stored in GridFS are two collections, fs.files and fs.chunks, and a file is complete only if every chunk came with it.
The oplog is not a change history. It is a capped collection in the local database that replica set members use to replicate, it discards its oldest entries as new ones arrive, and its entries are written in a repeatable form that records the result of a change, not the value it replaced. Change streams are a live feed built on it. If change history is offered, ask where it was saved. To test a sample, restore it to a scratch server, count BSON types per field path with $type, resolve a sample of references, and check each GridFS file's chunks against its length and chunkSize.
What to check before licensing
- Have the data owner and your counsel read MongoDB, Inc.'s terms for the server edition in use, or for Atlas, on exported data and API use.
- Ask for a field-path profile of every collection to full depth, and check the de-identification review covered each path, including keys inside arrays and free-form metadata objects.
- Search the sample for secrets stored as ordinary fields: password hashes, API keys, session tokens and connection strings in settings documents.
- Confirm the business's customer contracts allow the records to be licensed, especially where a multi-tenant application stores its own customers' uploads under a tenant ID field.
- Ask which tool and options produced the delivery, and do not accept mongoexport JSON or CSV unless it is canonical Extended JSON covering every field path.
- Ask which collections are capped or have a TTL index, since those hold only a recent window.
- Resolve a sample of ObjectId references after re-keying and compare the number that find no target with what the owner expects.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
Should we ask for BSON or JSON?
Ask for BSON from mongodump, or canonical Extended JSON if you need text. Both keep MongoDB's types, so an ObjectId stays distinct from a string and a Decimal128 price from a floating-point number. Relaxed Extended JSON, the mongoexport default, writes integers and doubles as plain numbers, and CSV drops types and any field nobody listed.
Does a MongoDB dump include change history?
No, a dump holds each document as it stood when it was read. MongoDB overwrites a document on update and keeps no earlier version, and the oplog covers only a recent window of operations. History exists only where the application embedded it, such as a status array, or where a change data capture pipeline saved it elsewhere.
How do we find the relationships between collections?
From the application, not the database. MongoDB declares no foreign keys, so a reference is a field holding another document's _id. Ask the owner for a reference map, or for the model definitions from the application's object mapper, such as Mongoose schemas, then verify it by resolving a sample of references from each collection.
Can a dataset come from MongoDB Atlas as well as self-managed servers?
Yes, the collections are the same either way. Atlas is the vendor's hosted service running the same database, and mongodump works against it. Hosted features can keep things outside the dumped collections, such as older documents moved to an archive tier. Ask whether any in-scope collection was archived, so the dump is not missing its oldest records.
How is personal data removed from nested documents?
It has to be removed by field path at every depth, because a column-by-column review does not fit documents. A document can carry an email inside an array of contacts, a card token in a payment sub-document, or a whole third-party API response saved under a metadata key. Ask for a redaction log by path and check it against your own scan of the sample. No de-identification method is perfect.
Is SourceX affiliated with MongoDB, Inc.?
MongoDB is named to identify the system the records come from. That does not imply a partnership with or endorsement by MongoDB, Inc. The records belong to the business that runs MongoDB, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.
Related datasets
- Relational business database exports
Populated relational databases from business applications, with schema, keys, constraints, code tables and a data dictionary
- Database schemas, migrations and stored procedures
Production schema definitions with the migration chain, procedural code and the review and rollback record
- Amazon DynamoDB tables
Chosen DynamoDB tables exported as items, with each table's key schema, secondary index definitions and the application's access pattern documentation
- Apache Cassandra tables
Rows of chosen keyspaces' tables with the CQL schema, primary key definitions and, on request, per-column write times and TTLs
- PostgreSQL application databases
A pg_dump of chosen schemas: table rows, declared constraints, views, functions, triggers and the application's own audit or history tables
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 26 November 2026.