Skip to content

Commit f59c13c

Browse files
committed
nit
1 parent b3e8852 commit f59c13c

File tree

1 file changed

+7
-5
lines changed
  • docs/integrations/data-ingestion/clickpipes/mongodb

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ title: 'ClickPipes for MongoDB FAQ'
1010

1111
### Can I query for individual fields in the JSON datatype? {#can-i-query-for-individual-fields-in-the-json-datatype}
1212

13-
Yes, ClickHouse provides powerful JSON querying capabilities.
14-
15-
1. **Dot Notation**: Direct field access
13+
You can use **dot notation** for direct field access:
1614
```sql
1715
SELECT doc.customer.name as name FROM your_table;
1816
```
19-
20-
2. **Nested Objects**: Use the `^` operator for sub-objects
17+
For nested object fields, use the `^` operator:
2118
```sql
2219
SELECT doc.^address.city AS city FROM your_table;
2320
```
21+
For aggregations, cast the field to the appropriate type with the `CAST` function or `::` syntax:
22+
```sql
23+
SELECT sum(doc.shipping.cost::Float32) AS total_shipping_cost FROM t1;
24+
```
25+
To learn more about working with JSON, see our [Working with JSON guide](./quickstart).
2426

2527
### How do I flatten the nested MongoDB documents in ClickHouse? {#how-do-i-flatten-the-nested-mongodb-documents-in-clickhouse}
2628

0 commit comments

Comments
 (0)