Skip to content

Commit

Permalink
Fixed indentations of code blocks for using easier numerics
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe442 committed Dec 16, 2024
1 parent aef5202 commit e98e2b5
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions product_docs/docs/mongo_data_adapter/5/06_features_of_mongo_fdw.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,33 +124,33 @@ Steps for retrieving sub-fields from the document:

1. Create a foreign table. To access a sub-field use the dot (".") in the columnn name as shown below:

```sql
CREATE FOREIGN TABLE ft_nested_json_test(
_id NAME,
key1 varchar,
"key2.subkey21" varchar,
"key2.subkey22" varchar,
"key2.subtstmp" timestamp
)SERVER mongo_server
OPTIONS (database 'db1', collection 'test-sub_json');
```
```sql
CREATE FOREIGN TABLE ft_nested_json_test(
_id NAME,
key1 varchar,
"key2.subkey21" varchar,
"key2.subkey22" varchar,
"key2.subtstmp" timestamp
)SERVER mongo_server
OPTIONS (database 'db1', collection 'test-sub_json');
```

2. Retrieve the document with sub-fields:
1. Retrieve the document with sub-fields:

```sql
SELECT * FROM ft_nested_json_test;
__OUTPUT__
_id | key1 | key2.subkey21 | key2.subkey22 | key2.subtstmp
--------------------------+-------+---------------+---------------+------------------------
658040214890799d6e0173d0 | hello | hello-sub1 | hello-sub2 | 16-DEC-22 19:16:17.801
```
```sql
SELECT * FROM ft_nested_json_test;
__OUTPUT__
_id | key1 | key2.subkey21 | key2.subkey22 | key2.subtstmp
--------------------------+-------+---------------+---------------+------------------------
658040214890799d6e0173d0 | hello | hello-sub1 | hello-sub2 | 16-DEC-22 19:16:17.801
```

3. Retrieve an individual field:
1. Retrieve an individual field:

```sql
SELECT "key2.subkey21" FROM ft_nested_json_test;
__OUTPUT__
key2.subkey21
---------------
hello-sub1
```
```sql
SELECT "key2.subkey21" FROM ft_nested_json_test;
__OUTPUT__
key2.subkey21
---------------
hello-sub1
```

0 comments on commit e98e2b5

Please sign in to comment.