Skip to content

Commit 313acc8

Browse files
authored
MongoDB destination connector: documents in collections should have at least a record_id field before attempting upserts (#395)
1 parent b72cf1f commit 313acc8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Note>
2+
For the destination connector, Unstructured recommends that all documents in the target collection have a field
3+
named `record_id` with a `String` data type.
4+
Unstructured can use this field to do intelligent document overwrites. Without this field, duplicate documents
5+
might be written to the collection or, in some cases, the operation could fail altogether.
6+
</Note>

snippets/general-shared-text/mongodb.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ allowfullscreen
1111
></iframe>
1212

1313
import AllowIPAddressRanges from '/snippets/general-shared-text/ip-address-ranges.mdx';
14+
import MongoDBRecordID from '/snippets/general-shared-text/mongodb-record-id.mdx';
15+
1416

1517
- A MongoDB Atlas account. [Create an account](https://www.mongodb.com/cloud/atlas/register).
1618
- A MongoDB Atlas cluster. [Create a cluster](https://www.mongodb.com/docs/atlas/tutorial/deploy-free-tier-cluster).
@@ -22,6 +24,9 @@ import AllowIPAddressRanges from '/snippets/general-shared-text/ip-address-range
2224
- The cluster must have at least one database. [Create a database](https://www.mongodb.com/docs/compass/current/databases/#create-a-database).
2325
- The database must have at least one user, and that user must have sufficient access to the database. [Create a database user](https://www.mongodb.com/docs/atlas/security-add-mongodb-users/#add-database-users). [Give the user database access](https://www.mongodb.com/docs/manual/core/authorization/).
2426
- The database must have at least one collection. [Create a collection](https://www.mongodb.com/docs/compass/current/collections/#create-a-collection).
27+
28+
<MongoDBRecordID />
29+
2530
- The connection string for the cluster. For MongoDB Atlas, this connection string must include the protocol, username, password, host, and cluster name. For example:
2631

2732
```text

0 commit comments

Comments
 (0)