Skip to content

Commit ddb68f9

Browse files
committed
mongo-faq
1 parent 738fd08 commit ddb68f9

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
sidebar_label: 'FAQ'
3+
description: 'Frequently asked questions about ClickPipes for MongoDB.'
4+
slug: /integrations/clickpipes/mongodb/faq
5+
sidebar_position: 2
6+
title: 'ClickPipes for MongoDB FAQ'
7+
---
8+
9+
# ClickPipes for MongoDB FAQ
10+
11+
### Can I query for individual fields in the JSON datatype? {#can-i-query-for-individual-fields-in-the-json-datatype}
12+
13+
Yes, ClickHouse provides powerful JSON querying capabilities.
14+
15+
1. **Dot Notation**: Direct field access
16+
```sql
17+
SELECT doc.customer.name as name FROM your_table;
18+
```
19+
20+
2. **Nested Objects**: Use the `^` operator for sub-objects
21+
```sql
22+
SELECT doc.^address.city AS city FROM your_table;
23+
```
24+
25+
### How do I flatten the nested MongoDB documents in ClickHouse? {#how-do-i-flatten-the-nested-mongodb-documents-in-clickhouse}
26+
27+
MongoDB documents are replicated as JSON type in ClickHouse by default, preserving the nested structure. You have several options to flatten this data. If you want to flatten the data to columns, you can use normal views, materialized views, or query-time access.
28+
29+
1. **Normal Views**: Use normal views to encapsulate flattening logic.
30+
2. **Materialized Views**: For smaller datasets, you can use refreshable materialized with FINAL to periodically flatten and deduplicate data. For larger datasets, we recommend using materialized views without FINAL to flatten the data in real-time, and then deduplicate data at query time.
31+
3. **Query-time Access**: Instead of flattening, use dot notation to access nested fields directly in queries.
32+
33+
For detailed examples, see our [Working with JSON guide](./quickstart).
34+
35+
### Can I connect MongoDB databases that don't have a public IP or are in private networks? {#can-i-connect-mongodb-databases-that-dont-have-a-public-ip-or-are-in-private-networks}
36+
37+
We support AWS PrivateLink for connecting to MongoDB databases that don't have a public IP or are in private networks.
38+
39+
### What happens if I delete a database/table from my MongoDB database? {#what-happens-if-i-delete-a-database-table-from-my-mongodb-database}
40+
41+
When you delete a database/table from MongoDB, ClickPipes will continue running but the dropped database/table will stop replicating changes. The corresponding tables in ClickHouse is preserved.
42+
43+
### How does MongoDB CDC Connector handle transactions? {#how-does-mongodb-cdc-connector-handle-transactions}
44+
45+
Each document change within a transaction is processed individually to ClickHouse. Changes are applied in the order they appear in the oplog; and only committed changes are replicated to ClickHouse. If a MongoDB transaction is rolled back, those changes won't appear in the change stream.
46+
47+
For more examples, see our [Working with JSON guide](./quickstart).
48+
49+
### How do I handle `resume of change stream was not possible, as the resume point may no longer be in the oplog.` error? {#resume-point-may-no-longer-be-in-the-oplog-error}
50+
51+
This error typically occurs when the oplog is truncated and ClickPipe is unable to resume the change stream at the expected point. To resolve this issue, [resync the ClickPipe](./resync.md). To avoid this issue from recurring, we recommend [increasing the oplog retention period](./source/atlas#enable-oplog-retention) (or [here](./source/generic#enable-oplog-retention) if you are on a self-managed MongoDB).
52+
53+
### How is replication managed? {#how-is-replication-managed}
54+
55+
We use MongoDB's native Change Streams API to track changes in the database. Change Streams API provides a resumable stream of database changes by leveraging MongoDB's oplog (operations log). ClickPipe uses MongoDB's resume tokens to track the position in the oplog and ensure every change is replicated to ClickHouse.
56+
57+
### Which read preference should I use? {#which-read-preference-should-i-use}
58+
59+
Which read preference to use depends on your specific use case. If you want to minimize the load on your primary node, we recommend using `secondaryPreferred` read preference. If you want to optimize ingestion latency, we recommend using `primaryPreferred` read preference. For more details, see [MongoDB documentation](https://www.mongodb.com/docs/manual/core/read-preference/#read-preference-modes-1).
60+
61+
### Does the MongoDB ClickPipe support Sharded Cluster? {#does-the-mongodb-clickpipe-support-sharded-cluster}
62+
Yes, the MongoDB ClickPipe supports both Replica Set and Sharded Cluster.

docs/integrations/data-ingestion/clickpipes/mongodb/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Image from '@theme/IdealImage';
1919
<BetaBadge/>
2020

2121
:::info
22-
Currently, ingesting data from MongoDB to ClickHouse Cloud via ClickPipes is in Private Preview.
22+
Currently, ingesting data from MongoDB to ClickHouse Cloud via ClickPipes is in Beta.
2323
:::
2424

2525
:::note

scripts/aspell-dict-file.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,3 +1103,5 @@ explorative
11031103
ReceiveMessage
11041104
--docs/integrations/data-ingestion/clickpipes/postgres/postgres_generated_columns.md--
11051105
RelationMessage
1106+
--docs/integrations/data-ingestion/clickpipes/mongodb/faq.md--
1107+
resumable

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ const sidebars = {
630630
"integrations/data-ingestion/clickpipes/mongodb/datatypes",
631631
"integrations/data-ingestion/clickpipes/mongodb/quickstart",
632632
"integrations/data-ingestion/clickpipes/mongodb/lifecycle",
633+
"integrations/data-ingestion/clickpipes/mongodb/faq",
633634
{
634635
type: "category",
635636
label: "Operations",

0 commit comments

Comments
 (0)