Skip to content

Commit 50fb40d

Browse files
committed
Integrate/MongoDB: Implement suggestions by CodeRabbit
1 parent accf5b3 commit 50fb40d

File tree

4 files changed

+27
-30
lines changed

4 files changed

+27
-30
lines changed

docs/integrate/mongodb/cloud.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,44 @@ The procedure for importing data from [MongoDB Atlas] into [CrateDB Cloud] is
44
similar, with a few small adjustments.
55

66
First, helpful aliases again:
7-
:::{code} shell
8-
alias ctk="docker run --rm -it ghcr.io/crate/cratedb-toolkit ctk"
7+
```shell
98
alias crash="docker run --rm -it ghcr.io/crate-workbench/cratedb-toolkit crash"
10-
:::
9+
alias ctk="docker run --rm -i ghcr.io/crate/cratedb-toolkit ctk"
10+
```
1111

1212
You will need your credentials for both CrateDB and MongoDB.
1313
These are, with examples:
1414

1515
**CrateDB Cloud**
16-
* Host: ```gray-wicket.aks1.westeurope.azure.cratedb.net```
17-
* Username: ```admin```
18-
* Password: ```-9..nn```
16+
* Host: `<CRATEDB_CLOUD_HOST>`
17+
* Username: `<CRATEDB_USER>`
18+
* Password: `<CRATEDB_PASSWORD>`
1919

2020
**MongoDB Atlas**
21-
* Host: ```cluster0.nttj7.mongodb.net```
22-
* User: ```admin```
23-
* Password: ```a1..d1```
21+
* Host: `<MONGODB_ATLAS_HOST>`
22+
* User: `<MONGODB_USER>`
23+
* Password: `<MONGODB_PASSWORD>`
2424

2525
For CrateDB, the credentials are displayed at time of cluster creation.
2626
For MongoDB, they can be found in the [cloud platform] itself.
2727

2828
Now, same as before, import data from MongoDB database/collection into
2929
CrateDB schema/table.
30-
:::{code} shell
30+
```shell
3131
ctk load table \
3232
"mongodb+srv://admin:[email protected]/testdrive/demo" \
3333
--cluster-url='crate://admin:[email protected]:4200/testdrive/demo?ssl=true'
34-
:::
34+
```
3535

36-
::: {note}
37-
Note the **necessary** `ssl=true` query parameter at the end of both database connection URLs
38-
when working on Cloud-to-Cloud transfers.
36+
:::{note}
37+
CrateDB Cloud requires `ssl=true` in the cluster URL. For MongoDB Atlas SRV URIs
38+
(`mongodb+srv://`), TLS is implied and no extra parameter is needed.
3939
:::
4040

4141
Verify that relevant data has been transferred to CrateDB.
42-
:::{code} shell
42+
```shell
4343
crash --hosts 'https://admin:[email protected]:4200' --command 'SELECT * FROM testdrive.demo;'
44-
:::
45-
44+
```
4645

4746

4847
[cloud platform]: https://cloud.mongodb.com

docs/integrate/mongodb/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ model
104104
:::
105105

106106
:::{note}
107-
The MongoDB I/O subsystem is based on the [migr8] migration utility package. Please also
108-
check its documentation to learn about more of its capabilities, supporting
109-
you when working with MongoDB.
107+
The MongoDB I/O subsystem is based on the [migr8] migration utility package. Consult its
108+
documentation for advanced capabilities when working with MongoDB.
110109
:::
111110

112111

docs/integrate/mongodb/model.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ data in schemas and tables.
1313
- A **field** in MongoDB is similar to a column in a CrateDB table. In both
1414
systems, fields (or columns) define the attributes for the records
1515
(or rows/documents).
16-
- A **primary key** in MongoDB is typically the _id field, which uniquely
16+
- A **primary key** in MongoDB is typically the `_id` field, which uniquely
1717
identifies a document within a collection. In CrateDB, a primary key
1818
uniquely identifies a row in a table.
1919
- An **index** in MongoDB is similar to an index in CrateDB. Both are used to
2020
improve query performance by providing a fast lookup for fields (or columns)
2121
within documents (or rows).
2222

23+
24+
:::{seealso}
2325
-- [Databases and Collections]
26+
:::
2427

2528

2629
[Databases and Collections]: https://www.mongodb.com/docs/manual/core/databases-and-collections/

docs/integrate/mongodb/tutorial.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ programs.
3838
::::{tab-set}
3939

4040
:::{tab-item} Linux and macOS
41-
To make the settings persistent, add them to your Shell profile (`~/.profile`).
41+
To make the settings persistent, add them to your shell profile (e.g., `~/.profile` or `~/.zshrc`).
4242
```shell
4343
alias crash="docker run --rm -it --network=cratedb-demo ghcr.io/crate/cratedb-toolkit crash"
4444
alias ctk="docker run --rm -i --network=cratedb-demo ghcr.io/crate/cratedb-toolkit ctk"
@@ -65,7 +65,7 @@ doskey mongosh=docker run --rm -i --network=cratedb-demo docker.io/mongo mongosh
6565

6666
## Usage
6767

68-
Insert record into MongoDB collection; you can also do it twice or more.
68+
Insert a record into a MongoDB collection; you can repeat this step as needed.
6969
```shell
7070
mongosh --host mongodb --eval 'db.testdrive.insert({"temperature": 42.84, "humidity": 83.1})'
7171
```
@@ -82,17 +82,13 @@ Inspect data stored in CrateDB.
8282
crash --hosts cratedb -c "SELECT * FROM doc.testdrive"
8383
```
8484

85-
::::{todo}
8685

87-
Import data to MongoDB:
86+
::::{tip}
87+
To bulk import example data into MongoDB:
8888
:::{code} shell
8989
mongoimport --db testdrive --collection demo --file demodata.json --jsonArray
9090
:::
91-
92-
:::{note}
93-
`mongoimport` is part of the [MongoDB Database tools].
94-
:::
95-
91+
Note: `mongoimport` is part of the [MongoDB Database tools].
9692
::::
9793

9894

0 commit comments

Comments
 (0)