From be3b0919219e1967ee6d44f7629ba3205dece66c Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Wed, 29 Nov 2023 01:12:43 +0100 Subject: [PATCH 1/9] Update docusaurus to v3.0 --- build/deps/docusaurus-docs.Dockerfile | 2 +- website/docs/configuration/flags.md | 12 ++++++------ website/docs/quickstart-guide/go.md | 2 +- website/docusaurus.config-blog.js | 6 +++--- website/docusaurus.config.js | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build/deps/docusaurus-docs.Dockerfile b/build/deps/docusaurus-docs.Dockerfile index 925b12dd4a50..d5fa4e7e71c2 100644 --- a/build/deps/docusaurus-docs.Dockerfile +++ b/build/deps/docusaurus-docs.Dockerfile @@ -1 +1 @@ -FROM ghcr.io/ferretdb/docusaurus-docs:2.4.3-3 +FROM ghcr.io/ferretdb/docusaurus-docs:3.0.0-1 \ No newline at end of file diff --git a/website/docs/configuration/flags.md b/website/docs/configuration/flags.md index 4a840d3dfea9..77ffbee25f92 100644 --- a/website/docs/configuration/flags.md +++ b/website/docs/configuration/flags.md @@ -58,9 +58,9 @@ Some default values are overridden in [our Docker image](../quickstart-guide/doc FerretDB uses [pgx v5](https://github.com/jackc/pgx) library for connecting to PostgreSQL. Supported URL parameters are documented there: -- -- -- +- [https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#ParseConfig](https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#ParseConfig) +- [https://pkg.go.dev/github.com/jackc/pgx/v5#ParseConfig](https://pkg.go.dev/github.com/jackc/pgx/v5#ParseConfig) +- [https://pkg.go.dev/github.com/jackc/pgx/v5/pgxpool#ParseConfig](https://pkg.go.dev/github.com/jackc/pgx/v5/pgxpool#ParseConfig) Additionally: @@ -80,9 +80,9 @@ Additionally: FerretDB uses [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) library for accessing SQLite database files. Supported URL parameters are documented there: -- -- -- +- [https://www.sqlite.org/uri.html](https://www.sqlite.org/uri.html) +- [https://pkg.go.dev/modernc.org/sqlite#Driver.Open](https://pkg.go.dev/modernc.org/sqlite#Driver.Open) +- [https://www.sqlite.org/pragma.html](https://www.sqlite.org/pragma.html) Additionally: diff --git a/website/docs/quickstart-guide/go.md b/website/docs/quickstart-guide/go.md index 22c44861cf0c..c9583b6d5a49 100644 --- a/website/docs/quickstart-guide/go.md +++ b/website/docs/quickstart-guide/go.md @@ -4,7 +4,7 @@ sidebar_position: 6 # Go -See . +See [https://pkg.go.dev/github.com/FerretDB/FerretDB/ferretdb](https://pkg.go.dev/github.com/FerretDB/FerretDB/ferretdb). _This section is not currently available. You can help FerretDB by contributing to this section. diff --git a/website/docusaurus.config-blog.js b/website/docusaurus.config-blog.js index 87f55c59f9b1..59a0dffab6d6 100644 --- a/website/docusaurus.config-blog.js +++ b/website/docusaurus.config-blog.js @@ -1,8 +1,8 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer/themes/github'); -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); +const lightCodeTheme = require('prism-react-renderer').themes.github; +const darkCodeTheme = require('prism-react-renderer').themes.dracula; /** @type {import('@docusaurus/types').Config} */ const config = { @@ -180,7 +180,7 @@ const config = { prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme, - additionalLanguages: ['go', 'json5', 'sql'], + additionalLanguages: ['go', 'sql'], }, mermaid: { theme: {light: 'default', dark: 'dark'}, diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 89ef88913239..2b1746d389e6 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -1,8 +1,8 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer/themes/github'); -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); +const lightCodeTheme = require('prism-react-renderer').themes.github; +const darkCodeTheme = require('prism-react-renderer').themes.dracula; /** @type {import('@docusaurus/types').Config} */ const config = { @@ -142,7 +142,7 @@ const config = { prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme, - additionalLanguages: ['go', 'json5', 'sql'], + additionalLanguages: ['go', 'sql'], }, mermaid: { theme: {light: 'default', dark: 'dark'}, From 209878a16d4305d89b20eb8cbcd43fdbb436d525 Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Thu, 30 Nov 2023 03:06:18 +0100 Subject: [PATCH 2/9] update codeblock from json5 to json --- ...25-ferretdb-fetches-data-query-pushdown.md | 2 +- .../2023-05-09-ferretdb-v-1-1-0-released.md | 32 ++++---- ...2023-06-19-ferretdb-v-1-4-0-new-release.md | 76 ++++++++++--------- ...retdb-demo-launch-test-database-minutes.md | 2 +- .../2023-07-28-grafana-monitoring-ferretdb.md | 2 +- ...all-ferretdb-mongodb-alternative-ubuntu.md | 3 +- .../blog/2023-10-31-mongodb-sorting-scalar.md | 36 ++++----- ...-package-and-deploy-ferretdb-with-acorn.md | 8 +- .../aggregation-pipeline-and-commands.md | 8 +- website/docs/basic-operations/read.md | 4 +- website/docs/contributing/writing-guide.md | 2 +- website/docs/indexes.md | 10 +-- website/docs/main.md | 2 +- .../docs/operators/query/array-operators.md | 6 +- .../docs/operators/query/bitwise-operators.md | 28 +++---- .../operators/query/comparison-operators.md | 18 ++--- .../docs/operators/query/element-operators.md | 6 +- .../operators/query/evaluation-operators.md | 6 +- .../docs/operators/query/logical-operators.md | 8 +- .../update/array-update-operators.md | 40 +++++----- .../update/field-update-operators.md | 16 ++-- website/docusaurus.config-blog.js | 2 +- website/docusaurus.config.js | 2 +- 23 files changed, 162 insertions(+), 157 deletions(-) diff --git a/website/blog/2023-01-25-ferretdb-fetches-data-query-pushdown.md b/website/blog/2023-01-25-ferretdb-fetches-data-query-pushdown.md index 0289cde230b1..ed81b9c940f7 100644 --- a/website/blog/2023-01-25-ferretdb-fetches-data-query-pushdown.md +++ b/website/blog/2023-01-25-ferretdb-fetches-data-query-pushdown.md @@ -98,7 +98,7 @@ This is needed for our internal representation of the documents called `pjson`, With these documents, FerretDB can parse the data to internal `pjson` type, and iterate through all of them to apply the filters. After this process, as only one document matches the filter, the projection will be applied to it, so only the `active` (and `_id`) fields will be returned: -```json5 +```json [{ _id: ObjectId("63aa97626786637ef1c4b725"), active: false }] ``` diff --git a/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md b/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md index 9013cdac5027..26b43989dbe7 100644 --- a/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md +++ b/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md @@ -70,12 +70,12 @@ db.store.aggregate([ The output document looks like this: -```json5 +```json [ { - _id: 1, - category: 'Electronics', - inventory: [{ product: 'Laptop', price: 1200, quantity: 10 }] + "_id": 1, + "category": "Electronics", + "inventory": [{ "product": "Laptop", "price": 1200, "quantity": 10 }] } ] ``` @@ -87,19 +87,19 @@ In the new release, we have added support for field projections assignment. With this feature, users can now specify which fields to retrieve from the database and assign new values to them in a single query. For instance, if we have a `users` collection as shown below: -```json5 +```json [ { - _id: 1, - name: 'John', - age: 30, - email: 'john@example.com' + "_id": 1, + "name": "John", + "age": 30, + "email": "john@example.com" }, { - _id: 2, - name: 'Jane', - age: 25, - email: 'jane@example.com' + "_id": 2, + "name": "Jane", + "age": 25, + "email": "jane@example.com" } ] ``` @@ -112,10 +112,10 @@ db.users.find({}, { name: 'Anonymous' }) The query will return: -```json5 +```json [ - { _id: 1, name: 'Anonymous' }, - { _id: 2, name: 'Anonymous' } + { "_id": 1, "name": "Anonymous" }, + { "_id": 2, "name": "Anonymous" } ] ``` diff --git a/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md b/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md index 77040a4d4207..9eec7e50e681 100644 --- a/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md +++ b/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md @@ -37,19 +37,19 @@ You can use the `$type` operator in a `$project` stage to return the BSON data t Suppose you have the following document: -```json5 +```json [ { - _id: 1, - name: 'John', - age: 35, - salary: 5000 + "_id": 1, + "name": "John", + "age": 35, + "salary": 5000 }, { - _id: 2, - name: 'Robert', - age: 42, - salary: 7000 + "_id": 2, + "name": "Robert", + "age": 42, + "salary": 7000 } ] ``` @@ -70,10 +70,10 @@ db.employees.aggregate([ The output will be: -```json5 +```json [ - { _id: 1, name: 'John', age: 35, ageType: 'int' }, - { _id: 2, name: 'Robert', age: 42, ageType: 'int' } + { "_id": 1, "name": "John", "age": 35, "ageType": "int" }, + { "_id": 2, "name": "Robert", "age": 42, "ageType": "int" } ] ``` @@ -99,23 +99,23 @@ db.employees.aggregate([ The output will be: -```json5 +```json [ { - _id: 1, - name: 'John', - age: 35, - salary: 5000, - department: 'HR', - employmentType: 'Full-time' + "_id": 1, + "name": "John", + "age": 35, + "salary": 5000, + "department": "HR", + "employmentType": "Full-time" }, { - _id: 2, - name: 'Robert', - age: 42, - salary: 7000, - department: 'HR', - employmentType: 'Full-time' + "_id": 2, + "name": "Robert", + "age": 42, + "salary": 7000, + "department": "HR", + "employmentType": "Full-time" } ] ``` @@ -134,15 +134,21 @@ db.employees.aggregate([ The output: -```json5 +```json [ - { _id: 1, name: 'John', age: 35, salary: 5000, department: 'Sales' }, { - _id: 2, - name: 'Robert', - age: 42, - salary: 7000, - department: 'Sales' + "_id": 1, + "name": "John", + "age": 35, + "salary": 5000, + "department": "Sales" + }, + { + "_id": 2, + "name": "Robert", + "age": 42, + "salary": 7000, + "department": "Sales" } ] ``` @@ -159,10 +165,10 @@ db.employees.aggregate([ Output: -```json5 +```json [ - { _id: 1, name: 'John', age: 35 }, - { _id: 2, name: 'Robert', age: 42 } + { "_id": 1, "name": "John", "age": 35 }, + { "_id": 2, "name": "Robert", "age": 42 } ] ``` diff --git a/website/blog/2023-06-21-ferretdb-demo-launch-test-database-minutes.md b/website/blog/2023-06-21-ferretdb-demo-launch-test-database-minutes.md index 43eaf5b8b924..47fd6020f385 100644 --- a/website/blog/2023-06-21-ferretdb-demo-launch-test-database-minutes.md +++ b/website/blog/2023-06-21-ferretdb-demo-launch-test-database-minutes.md @@ -130,7 +130,7 @@ db.demo.find() Output: -```json5 +```json [ { _id: ObjectId("648bc0619df6027209a65b40"), diff --git a/website/blog/2023-07-28-grafana-monitoring-ferretdb.md b/website/blog/2023-07-28-grafana-monitoring-ferretdb.md index 78b39bf44c81..71c0bc8b238e 100644 --- a/website/blog/2023-07-28-grafana-monitoring-ferretdb.md +++ b/website/blog/2023-07-28-grafana-monitoring-ferretdb.md @@ -74,7 +74,7 @@ The advantages are endless! Here's a sample view of a document in the `issues` collection: -```json5 +```json { _id: ObjectId("64b7e557921f991a8697d6fd"), number: 179, diff --git a/website/blog/2023-10-19-install-ferretdb-mongodb-alternative-ubuntu.md b/website/blog/2023-10-19-install-ferretdb-mongodb-alternative-ubuntu.md index 49541346efd9..a499eeb589b0 100644 --- a/website/blog/2023-10-19-install-ferretdb-mongodb-alternative-ubuntu.md +++ b/website/blog/2023-10-19-install-ferretdb-mongodb-alternative-ubuntu.md @@ -217,9 +217,8 @@ Other necessary flags are set to their default values: `--mode="normal"`, `--lis Creating a `systemd` service file for FerretDB will allow the database be managed by the `systemd` system and service manager. -:::warning +:::caution Please ensure to have a non-root user configured with `sudo` privileges. - Incase you don't, let's create a new user `ferret` with `sudo` privileges: ```sh diff --git a/website/blog/2023-10-31-mongodb-sorting-scalar.md b/website/blog/2023-10-31-mongodb-sorting-scalar.md index 904a986b6f91..ec8f1743e4c2 100644 --- a/website/blog/2023-10-31-mongodb-sorting-scalar.md +++ b/website/blog/2023-10-31-mongodb-sorting-scalar.md @@ -90,13 +90,13 @@ To sort these documents in ascending order based on the `size` field, you would db.outfits.find().sort({ size: 1 }) ``` -```json5 +```json [ - { _id: 5, name: 'slippers' }, - { _id: 3, name: 'boots', size: 8, color: 'black' }, - { _id: 4, name: 'sneakers', size: 8.5, color: 'blue' }, - { _id: 2, name: 'sandals', size: 9, color: null }, - { _id: 1, name: 'flip flops', size: 'M', color: 'blue' } + { "_id": 5, "name": "slippers" }, + { "_id": 3, "name": "boots", "size": 8, "color": "black" }, + { "_id": 4, "name": "sneakers", "size": 8.5, "color": "blue" }, + { "_id": 2, "name": "sandals", "size": 9, "color": null }, + { "_id": 1, "name": "flip flops", "size": "M", "color": "blue" } ] ``` @@ -120,13 +120,13 @@ To sort the documents in descending order by the `size` field, you would use a s db.outfits.find().sort({ size: -1 }) ``` -```json5 +```json [ - { _id: 1, name: 'flip flops', size: 'M', color: 'blue' }, - { _id: 2, name: 'sandals', size: 9, color: null }, - { _id: 4, name: 'sneakers', size: 8.5, color: 'blue' }, - { _id: 3, name: 'boots', size: 8, color: 'black' }, - { _id: 5, name: 'slippers' } + { "_id": 1, "name": "flip flops", "size": "M", "color": "blue" }, + { "_id": 2, "name": "sandals", "size": 9, "color": null }, + { "_id": 4, "name": "sneakers", "size": 8.5, "color": "blue" }, + { "_id": 3, "name": "boots", "size": 8, "color": "black" }, + { "_id": 5, "name": "slippers" } ] ``` @@ -149,13 +149,13 @@ The `_id` field value is unique within the collection which ensures that the sor db.outfits.find().sort({ color: 1, _id: 1 }) ``` -```json5 +```json [ - { _id: 2, name: 'sandals', size: 9, color: null }, - { _id: 5, name: 'slippers' }, - { _id: 3, name: 'boots', size: 8, color: 'black' }, - { _id: 1, name: 'flip flops', size: 'M', color: 'blue' }, - { _id: 4, name: 'sneakers', size: 8.5, color: 'blue' } + { "_id": 2, "name": "sandals", "size": 9, "color": null }, + { "_id": 5, "name": "slippers" }, + { "_id": 3, "name": "boots", "size": 8, "color": "black" }, + { "_id": 1, "name": "flip flops", "size": "M", "color": "blue" }, + { "_id": 4, "name": "sneakers", "size": 8.5, "color": "blue" } ] ``` diff --git a/website/blog/2023-11-15-how-to-package-and-deploy-ferretdb-with-acorn.md b/website/blog/2023-11-15-how-to-package-and-deploy-ferretdb-with-acorn.md index f7fdcae445e1..1c463ea5018a 100644 --- a/website/blog/2023-11-15-how-to-package-and-deploy-ferretdb-with-acorn.md +++ b/website/blog/2023-11-15-how-to-package-and-deploy-ferretdb-with-acorn.md @@ -282,10 +282,10 @@ The service is not considered highly available and can be easily replaced with o The `admin` credentials for `postgres` include: -- POSTGRES_HOST: "@{service.db.address}" -- POSTGRES_DB: "@{service.db.data.dbName}" -- POSTGRES_USER: "@{service.db.secrets.admin.username}" -- POSTGRES_PASSWORD: "@{service.db.secrets.admin.password}" +- POSTGRES_HOST: `@{service.db.address}` +- POSTGRES_DB: `@{service.db.data.dbName}` +- POSTGRES_USER: `@{service.db.secrets.admin.username}` +- POSTGRES_PASSWORD: `@{service.db.secrets.admin.password}` The `admin` credentials are then consumed by the `ferretdb` container via `@{service.db.xxx}` variables. To connect to the `postgres` backend, we will specify the `postgres` for the `FERRETDB_POSTGRESQL_URL` environment variable. diff --git a/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md b/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md index 129926ec89b0..6f06acbc78fe 100644 --- a/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md +++ b/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md @@ -50,11 +50,11 @@ Finally, the `$sort` stage sorts the documents by the `totalPrice` field in desc So the above aggregation pipeline operation would return the following result: -```json5 +```json [ - { _id: 'Home', totalPrice: 2700, productCount: 2 }, - { _id: 'Clothing', totalPrice: 80, productCount: 2 }, - { _id: 'Books', totalPrice: 60, productCount: 2 } + { "_id": "Home", "totalPrice": 2700, "productCount": 2 }, + { "_id": "Clothing", "totalPrice": 80, "productCount": 2 }, + { "_id": "Books", "totalPrice": 60, "productCount": 2 } ] ``` diff --git a/website/docs/basic-operations/read.md b/website/docs/basic-operations/read.md index bc43096aaa90..29d03b9751ce 100644 --- a/website/docs/basic-operations/read.md +++ b/website/docs/basic-operations/read.md @@ -142,7 +142,7 @@ db.employees.find({ catalog: 'printer' }) The response displays all the retrieved documents: -```json5 +```json [ { _id: ObjectId("636b39f80466c61a229bbf9b"), @@ -174,7 +174,7 @@ db.employees.find({ 'catalog.2': 'blender' }) The document that matches the array query is displayed in the response: -```json5 +```json [ { _id: ObjectId("636b3b0e0466c61a229bbf9c"), diff --git a/website/docs/contributing/writing-guide.md b/website/docs/contributing/writing-guide.md index 0f092af63ed5..b13dbf147b0d 100644 --- a/website/docs/contributing/writing-guide.md +++ b/website/docs/contributing/writing-guide.md @@ -107,7 +107,7 @@ For MongoDB shell results, use `json5` language and copy&paste the output as-is, with unquoted field names, single quotes for strings, without trailing commas, etc. Our tooling will not reformat those blocks. -```json5 +```json [ { _id: ObjectId("63109e9251bcc5e0155db0c2"), diff --git a/website/docs/indexes.md b/website/docs/indexes.md index fe85f053a156..21b37fcdb19a 100644 --- a/website/docs/indexes.md +++ b/website/docs/indexes.md @@ -18,11 +18,11 @@ The `createIndexes()` command takes two arguments: a document containing the ind You can create single field indexes or compound indexes. -### Single Field Indexes +### Single field indexes Suppose a `products` collection contains the following documents: -```js +```json { _id: 1, name: "iPhone 12", category: "smartphone", price: 799 } { _id: 2, name: "iPad Pro", category: "tablet", price: 999 } { _id: 3, name: "Galaxy S21", category: "smartphone", price: 699 } @@ -42,7 +42,7 @@ This creates an ascending index on the `price` field. If it's `-1`, it specifies a descending order direction for the index. ::: -### Compound Indexes +### Compound indexes For compound indexes, you can create an index key combining multiple fields together as a key. Below is an example of a compound index that uses `price` and `category` fields @@ -52,7 +52,7 @@ from the `products` collection as the index key: db.products.createIndex({ price: 1, category: 1 }) ``` -### Unique Indexes +### Unique indexes You can create unique indexes to ensure that the indexed fields do not contain duplicate values. To create a unique index, set the `unique` option as `true` when calling `createIndexes()` command. @@ -79,7 +79,7 @@ db.products.createIndex({ category: 1, name: 1 }, { unique: true }) Instead, it will simply return the name and key of the existing index, since duplicate indexes would be redundant and inefficient. - Meanwhile, any attempt to call `createIndexes()` command for an existing index using the same name and different key, _or_ different name but the same key will return an error. -## How to list Indexes +## How to list indexes To display a collection's index details, use the `listIndexes()` command. You can also use the `getIndexes()` method to call the `listIndexes()` command. diff --git a/website/docs/main.md b/website/docs/main.md index 76f33545b453..0b73f85aad8e 100644 --- a/website/docs/main.md +++ b/website/docs/main.md @@ -31,7 +31,7 @@ and [contributing guidelines](https://github.com/FerretDB/FerretDB/blob/main/CON ## Community -- Website and blog: [https://ferretdb.io](https://ferretdb.io/). +- Website and blog: [https://ferretdb.com](https://ferretdb.com/). - Twitter: [@ferret_db](https://twitter.com/ferret_db). - Mastodon: [@ferretdb@techhub.social](https://techhub.social/@ferretdb). - [Slack chat](https://join.slack.com/t/ferretdb/shared_invite/zt-zqe9hj8g-ZcMG3~5Cs5u9uuOPnZB8~A) for quick questions. diff --git a/website/docs/operators/query/array-operators.md b/website/docs/operators/query/array-operators.md index e4943f0e00a3..d018d380013a 100644 --- a/website/docs/operators/query/array-operators.md +++ b/website/docs/operators/query/array-operators.md @@ -85,7 +85,7 @@ db.team.find({ The output: -```json5 +```json [ { _id: ObjectId("63a5bb4acf72d6203bb45bb5"), @@ -121,7 +121,7 @@ db.team.find({ The output: -```json5 +```json [ { _id: ObjectId("63aa247e69c82de72bd40b93"), @@ -153,7 +153,7 @@ db.team.find({ The output: -```json5 +```json [ { _id: ObjectId("63aa247e69c82de72bd40b92"), diff --git a/website/docs/operators/query/bitwise-operators.md b/website/docs/operators/query/bitwise-operators.md index 14a01d1756f5..198ef72a3577 100644 --- a/website/docs/operators/query/bitwise-operators.md +++ b/website/docs/operators/query/bitwise-operators.md @@ -60,8 +60,8 @@ db.numbers.find({ The output: -```json5 -[{ _id: 2, value: 56, binaryValue: '111000' }] +```json +[{ "_id": 2, "value": 56, "binaryValue": "111000" }] ``` For the same query above, the bitmask can also be written as a BinData value: @@ -92,10 +92,10 @@ db.numbers.find({ The output: -```json5 +```json [ - { _id: 1, value: 23, binaryValue: '10111' }, - { _id: 4, value: 102, binaryValue: '1100110' } + { "_id": 1, "value": 23, "binaryValue": "10111" }, + { "_id": 4, "value": 102, "binaryValue": "1100110" } ] ``` @@ -119,11 +119,11 @@ db.numbers.find({ The output: -```json5 +```json [ - { _id: 2, value: 56, binaryValue: '111000' }, - { _id: 3, value: 67, binaryValue: '1000011' }, - { _id: 4, value: 102, binaryValue: '1100110' } + { "_id": 2, "value": 56, "binaryValue": "111000" }, + { "_id": 3, "value": 67, "binaryValue": "1000011" }, + { "_id": 4, "value": 102, "binaryValue": "1100110" } ] ``` @@ -147,12 +147,12 @@ db.numbers.find({ The output: -```json5 +```json [ - { _id: 1, value: 23, binaryValue: '10111' }, - { _id: 3, value: 67, binaryValue: '1000011' }, - { _id: 4, value: 102, binaryValue: '1100110' }, - { _id: 5, value: 5, binaryValue: '101' } + { "_id": 1, "value": 23, "binaryValue": "10111" }, + { "_id": 3, "value": 67, "binaryValue": "1000011" }, + { "_id": 4, "value": 102, "binaryValue": "1100110" }, + { "_id": 5, "value": 5, "binaryValue": "101" } ] ``` diff --git a/website/docs/operators/query/comparison-operators.md b/website/docs/operators/query/comparison-operators.md index e4033deffece..cea1dbf6436a 100644 --- a/website/docs/operators/query/comparison-operators.md +++ b/website/docs/operators/query/comparison-operators.md @@ -76,7 +76,7 @@ db.employees.find({ The response returns a single document that matches the query: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0e"), @@ -102,7 +102,7 @@ db.employees.find({ The response returns a single document that matches the query: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -133,7 +133,7 @@ db.employees.find({ The output: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -172,7 +172,7 @@ db.employees.find({ The output: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -219,7 +219,7 @@ db.employees.find({ The output: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -259,7 +259,7 @@ db.employees.find({ The output: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0e"), @@ -290,7 +290,7 @@ db.employees.find({ The output: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0d"), @@ -329,7 +329,7 @@ db.employees.find({ The output: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -369,7 +369,7 @@ db.employees.find({ The output: -```json5 +```json [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), diff --git a/website/docs/operators/query/element-operators.md b/website/docs/operators/query/element-operators.md index c18d1f105a15..e2564066e662 100644 --- a/website/docs/operators/query/element-operators.md +++ b/website/docs/operators/query/element-operators.md @@ -126,7 +126,7 @@ db.electronics.find({ The output: -```json5 +```json [ { _id: ObjectId("63a32fc7cf72d6203bb45b8e"), @@ -196,7 +196,7 @@ db.electronics.find({ The output: -```json5 +```json [ { _id: ObjectId("63a32fc7cf72d6203bb45b8e"), @@ -310,7 +310,7 @@ db.electronics.find({ The output: -```json5 +```json [ { _id: ObjectId("63a32fc7cf72d6203bb45b8e"), diff --git a/website/docs/operators/query/evaluation-operators.md b/website/docs/operators/query/evaluation-operators.md index 3a6b046ecaf0..c038d304b922 100644 --- a/website/docs/operators/query/evaluation-operators.md +++ b/website/docs/operators/query/evaluation-operators.md @@ -62,7 +62,7 @@ db.catalog.find({ The output: -```json5 +```json [ { _id: ObjectId("63e3ac0184f488929a3f737a"), @@ -104,7 +104,7 @@ db.catalog.find({ The output: -```json5 +```json [ { _id: ObjectId("63e4ce469695494b86bf2b2d"), @@ -146,7 +146,7 @@ db.catalog.find({ The output: -```json5 +```json [ { _id: ObjectId("63e3ac0184f488929a3f7379"), diff --git a/website/docs/operators/query/logical-operators.md b/website/docs/operators/query/logical-operators.md index aec278a1fb05..35fd9fdbe3d1 100644 --- a/website/docs/operators/query/logical-operators.md +++ b/website/docs/operators/query/logical-operators.md @@ -106,7 +106,7 @@ db.catalog.find({ The output: -```json5 +```json [ { _id: ObjectId("639ba4a0071b6bed396a8f13"), @@ -170,7 +170,7 @@ db.catalog.find({ The output: -```json5 +```json [ { _id: ObjectId("639ba4a0071b6bed396a8f13"), @@ -228,7 +228,7 @@ db.catalog.find({ The output: -```json5 +```json [ { _id: ObjectId("639ba4a0071b6bed396a8f15"), @@ -292,7 +292,7 @@ db.catalog.find({ The output: -```json5 +```json [ { _id: ObjectId("639ba4a0071b6bed396a8f14"), diff --git a/website/docs/operators/update/array-update-operators.md b/website/docs/operators/update/array-update-operators.md index 6c7c6df4bad7..cf3fb6b99681 100644 --- a/website/docs/operators/update/array-update-operators.md +++ b/website/docs/operators/update/array-update-operators.md @@ -34,11 +34,11 @@ db.store.updateOne({ _id: 1 }, { $push: { items: 'markers' } }) After the operation, the updated document looks like this: -```json5 +```json [ { - _id: 1, - items: ['pens', 'pencils', 'paper', 'erasers', 'rulers', 'markers'] + "_id": 1, + "items": ["pens", "pencils", "paper", "erasers", "rulers", "markers"] } ] ``` @@ -62,8 +62,8 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { items: 'paper' } }) The document is subsequently updated with the new element, as depicted below: -```json5 -[{ _id: 1, items: ['pens', 'pencils', 'paper'] }] +```json +[{ "_id": 1, "items": ["pens", "pencils", "paper"] }] ``` **Example:** Use the `$addToSet` operator to update the array with already existing elements. @@ -74,8 +74,8 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { items: 'pens' } }) Since the array already contains the element, there won't be any changes. -```json5 -[{ _id: 1, items: ['pens', 'pencils', 'paper'] }] +```json +[{ "_id": 1, "items": ["pens", "pencils", "paper"] }] ``` :::note @@ -92,8 +92,8 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { colors: 'red' } }) The updated document looks like this: -```json5 -[{ _id: 1, items: ['pens', 'pencils', 'paper'], colors: ['red'] }] +```json +[{ "_id": 1, "items": ["pens", "pencils", "paper"], "colors": ["red"] }] ``` ## $pop @@ -117,11 +117,11 @@ db.products.updateOne({ _id: 1 }, { $pop: { items: -1 } }) The document is subsequently updated with the first element `pens` removed, as depicted below: -```json5 +```json [ { - _id: 1, - items: ['pencils', 'paper', 'erasers', 'rulers'] + "_id": 1, + "items": ["pencils", "paper", "erasers", "rulers"] } ] ``` @@ -134,11 +134,11 @@ db.products.updateOne({ _id: 1 }, { $pop: { items: 1 } }) The updated now looks like this: -```json5 +```json [ { - _id: 1, - items: ['pencils', 'paper', 'erasers'] + "_id": 1, + "items": ["pencils", "paper", "erasers"] } ] ``` @@ -166,11 +166,11 @@ db.store.updateOne( After removing all instances of the specified array elements, the document is updated as follows: -```json5 +```json [ { - _id: 1, - items: ['erasers', 'rulers'] + "_id": 1, + "items": ["erasers", "rulers"] } ] ``` @@ -210,6 +210,6 @@ db.fruits.update( The updated document now looks like this: -```json5 -[{ _id: 1, fruits: [{ type: 'orange', color: 'orange' }] }] +```json +[{ "_id": 1, "fruits": [{ "type": "orange", "color": "orange" }] }] ``` diff --git a/website/docs/operators/update/field-update-operators.md b/website/docs/operators/update/field-update-operators.md index 303615272247..33f6df2b05ef 100644 --- a/website/docs/operators/update/field-update-operators.md +++ b/website/docs/operators/update/field-update-operators.md @@ -60,7 +60,7 @@ The above query updates the value of the `city` field in the `address` embedded This is the updated document: -```json5 +```json [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -94,7 +94,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $unset: { 'address.zip': '' } }) Below is the updated document, without the `zip` field: -```json5 +```json [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -128,7 +128,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $inc: { age: 1 } }) The updated document looks like this: -```json5 +```json [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -162,7 +162,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $mul: { salary: 1.25 } }) The updated record looks like this: -```json5 +```json [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -195,7 +195,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $rename: { jobTitle: 'title' } }) The updated document looks like this: -```json5 +```json [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -229,7 +229,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $min: { age: 30 } }) Since `30` is less than `36`, the value of the `age` field is updated to `30`. The updated document now looks like this: -```json5 +```json [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -262,7 +262,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $max: { age: 40 } }) This is what the updated document looks like: -```json5 +```json [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -296,7 +296,7 @@ db.employee.updateOne( This is the document after the update: -```json5 +```json [ { _id: ObjectId("640a603558955e0e2b57c00d"), diff --git a/website/docusaurus.config-blog.js b/website/docusaurus.config-blog.js index 59a0dffab6d6..d7bb2eaaa25d 100644 --- a/website/docusaurus.config-blog.js +++ b/website/docusaurus.config-blog.js @@ -180,7 +180,7 @@ const config = { prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme, - additionalLanguages: ['go', 'sql'], + additionalLanguages: ['go', 'sql', 'json'], }, mermaid: { theme: {light: 'default', dark: 'dark'}, diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 2b1746d389e6..10beae7a6442 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -142,7 +142,7 @@ const config = { prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme, - additionalLanguages: ['go', 'sql'], + additionalLanguages: ['go', 'sql', 'json'], }, mermaid: { theme: {light: 'default', dark: 'dark'}, From 0da53296c190488124e27fe8e6ca61d6559c2eed Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Fri, 1 Dec 2023 01:18:15 +0100 Subject: [PATCH 3/9] load json before json5 --- ...2-11-08-pjson-how-to-store-bson-in-jsonb.md | 2 +- ...-25-ferretdb-fetches-data-query-pushdown.md | 2 +- .../2023-05-09-ferretdb-v-1-1-0-released.md | 6 +++--- .../2023-06-19-ferretdb-v-1-4-0-new-release.md | 10 +++++----- ...rretdb-demo-launch-test-database-minutes.md | 2 +- .../2023-07-28-grafana-monitoring-ferretdb.md | 2 +- .../blog/2023-10-31-mongodb-sorting-scalar.md | 6 +++--- .../aggregation-pipeline-and-commands.md | 2 +- website/docs/basic-operations/read.md | 4 ++-- website/docs/contributing/writing-guide.md | 2 +- website/docs/indexes.md | 2 +- .../docs/operators/query/array-operators.md | 6 +++--- .../docs/operators/query/bitwise-operators.md | 8 ++++---- .../operators/query/comparison-operators.md | 18 +++++++++--------- .../docs/operators/query/element-operators.md | 6 +++--- .../operators/query/evaluation-operators.md | 6 +++--- .../docs/operators/query/logical-operators.md | 8 ++++---- .../operators/update/array-update-operators.md | 16 ++++++++-------- .../operators/update/field-update-operators.md | 16 ++++++++-------- website/docusaurus.config-blog.js | 9 ++++----- website/docusaurus.config.js | 9 ++++----- 21 files changed, 70 insertions(+), 72 deletions(-) diff --git a/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md b/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md index 9e8f23ad6b4d..0b96d0bda161 100644 --- a/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md +++ b/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md @@ -32,7 +32,7 @@ Here the hexadecimal `\x00` notation represents `0000 0000` in bits and similarl In BSON, `\x00` is a byte used as a terminator to indicate the end of a document. In BSON, field names use `cstring` which are UTF-8 characters followed by `\x00`. -```json +```json5 { "foo": "bar" } ``` diff --git a/website/blog/2023-01-25-ferretdb-fetches-data-query-pushdown.md b/website/blog/2023-01-25-ferretdb-fetches-data-query-pushdown.md index ed81b9c940f7..0289cde230b1 100644 --- a/website/blog/2023-01-25-ferretdb-fetches-data-query-pushdown.md +++ b/website/blog/2023-01-25-ferretdb-fetches-data-query-pushdown.md @@ -98,7 +98,7 @@ This is needed for our internal representation of the documents called `pjson`, With these documents, FerretDB can parse the data to internal `pjson` type, and iterate through all of them to apply the filters. After this process, as only one document matches the filter, the projection will be applied to it, so only the `active` (and `_id`) fields will be returned: -```json +```json5 [{ _id: ObjectId("63aa97626786637ef1c4b725"), active: false }] ``` diff --git a/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md b/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md index 26b43989dbe7..a32e6d00beaa 100644 --- a/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md +++ b/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md @@ -70,7 +70,7 @@ db.store.aggregate([ The output document looks like this: -```json +```json5 [ { "_id": 1, @@ -87,7 +87,7 @@ In the new release, we have added support for field projections assignment. With this feature, users can now specify which fields to retrieve from the database and assign new values to them in a single query. For instance, if we have a `users` collection as shown below: -```json +```json5 [ { "_id": 1, @@ -112,7 +112,7 @@ db.users.find({}, { name: 'Anonymous' }) The query will return: -```json +```json5 [ { "_id": 1, "name": "Anonymous" }, { "_id": 2, "name": "Anonymous" } diff --git a/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md b/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md index 9eec7e50e681..7b0c44a20881 100644 --- a/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md +++ b/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md @@ -37,7 +37,7 @@ You can use the `$type` operator in a `$project` stage to return the BSON data t Suppose you have the following document: -```json +```json5 [ { "_id": 1, @@ -70,7 +70,7 @@ db.employees.aggregate([ The output will be: -```json +```json5 [ { "_id": 1, "name": "John", "age": 35, "ageType": "int" }, { "_id": 2, "name": "Robert", "age": 42, "ageType": "int" } @@ -99,7 +99,7 @@ db.employees.aggregate([ The output will be: -```json +```json5 [ { "_id": 1, @@ -134,7 +134,7 @@ db.employees.aggregate([ The output: -```json +```json5 [ { "_id": 1, @@ -165,7 +165,7 @@ db.employees.aggregate([ Output: -```json +```json5 [ { "_id": 1, "name": "John", "age": 35 }, { "_id": 2, "name": "Robert", "age": 42 } diff --git a/website/blog/2023-06-21-ferretdb-demo-launch-test-database-minutes.md b/website/blog/2023-06-21-ferretdb-demo-launch-test-database-minutes.md index 47fd6020f385..43eaf5b8b924 100644 --- a/website/blog/2023-06-21-ferretdb-demo-launch-test-database-minutes.md +++ b/website/blog/2023-06-21-ferretdb-demo-launch-test-database-minutes.md @@ -130,7 +130,7 @@ db.demo.find() Output: -```json +```json5 [ { _id: ObjectId("648bc0619df6027209a65b40"), diff --git a/website/blog/2023-07-28-grafana-monitoring-ferretdb.md b/website/blog/2023-07-28-grafana-monitoring-ferretdb.md index 71c0bc8b238e..78b39bf44c81 100644 --- a/website/blog/2023-07-28-grafana-monitoring-ferretdb.md +++ b/website/blog/2023-07-28-grafana-monitoring-ferretdb.md @@ -74,7 +74,7 @@ The advantages are endless! Here's a sample view of a document in the `issues` collection: -```json +```json5 { _id: ObjectId("64b7e557921f991a8697d6fd"), number: 179, diff --git a/website/blog/2023-10-31-mongodb-sorting-scalar.md b/website/blog/2023-10-31-mongodb-sorting-scalar.md index ec8f1743e4c2..1b38adc64eb5 100644 --- a/website/blog/2023-10-31-mongodb-sorting-scalar.md +++ b/website/blog/2023-10-31-mongodb-sorting-scalar.md @@ -90,7 +90,7 @@ To sort these documents in ascending order based on the `size` field, you would db.outfits.find().sort({ size: 1 }) ``` -```json +```json5 [ { "_id": 5, "name": "slippers" }, { "_id": 3, "name": "boots", "size": 8, "color": "black" }, @@ -120,7 +120,7 @@ To sort the documents in descending order by the `size` field, you would use a s db.outfits.find().sort({ size: -1 }) ``` -```json +```json5 [ { "_id": 1, "name": "flip flops", "size": "M", "color": "blue" }, { "_id": 2, "name": "sandals", "size": 9, "color": null }, @@ -149,7 +149,7 @@ The `_id` field value is unique within the collection which ensures that the sor db.outfits.find().sort({ color: 1, _id: 1 }) ``` -```json +```json5 [ { "_id": 2, "name": "sandals", "size": 9, "color": null }, { "_id": 5, "name": "slippers" }, diff --git a/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md b/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md index 6f06acbc78fe..2b4c9c27c083 100644 --- a/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md +++ b/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md @@ -50,7 +50,7 @@ Finally, the `$sort` stage sorts the documents by the `totalPrice` field in desc So the above aggregation pipeline operation would return the following result: -```json +```json5 [ { "_id": "Home", "totalPrice": 2700, "productCount": 2 }, { "_id": "Clothing", "totalPrice": 80, "productCount": 2 }, diff --git a/website/docs/basic-operations/read.md b/website/docs/basic-operations/read.md index 29d03b9751ce..bc43096aaa90 100644 --- a/website/docs/basic-operations/read.md +++ b/website/docs/basic-operations/read.md @@ -142,7 +142,7 @@ db.employees.find({ catalog: 'printer' }) The response displays all the retrieved documents: -```json +```json5 [ { _id: ObjectId("636b39f80466c61a229bbf9b"), @@ -174,7 +174,7 @@ db.employees.find({ 'catalog.2': 'blender' }) The document that matches the array query is displayed in the response: -```json +```json5 [ { _id: ObjectId("636b3b0e0466c61a229bbf9c"), diff --git a/website/docs/contributing/writing-guide.md b/website/docs/contributing/writing-guide.md index b13dbf147b0d..0f092af63ed5 100644 --- a/website/docs/contributing/writing-guide.md +++ b/website/docs/contributing/writing-guide.md @@ -107,7 +107,7 @@ For MongoDB shell results, use `json5` language and copy&paste the output as-is, with unquoted field names, single quotes for strings, without trailing commas, etc. Our tooling will not reformat those blocks. -```json +```json5 [ { _id: ObjectId("63109e9251bcc5e0155db0c2"), diff --git a/website/docs/indexes.md b/website/docs/indexes.md index 21b37fcdb19a..37f5e2e170c4 100644 --- a/website/docs/indexes.md +++ b/website/docs/indexes.md @@ -22,7 +22,7 @@ You can create single field indexes or compound indexes. Suppose a `products` collection contains the following documents: -```json +```json5 { _id: 1, name: "iPhone 12", category: "smartphone", price: 799 } { _id: 2, name: "iPad Pro", category: "tablet", price: 999 } { _id: 3, name: "Galaxy S21", category: "smartphone", price: 699 } diff --git a/website/docs/operators/query/array-operators.md b/website/docs/operators/query/array-operators.md index d018d380013a..e4943f0e00a3 100644 --- a/website/docs/operators/query/array-operators.md +++ b/website/docs/operators/query/array-operators.md @@ -85,7 +85,7 @@ db.team.find({ The output: -```json +```json5 [ { _id: ObjectId("63a5bb4acf72d6203bb45bb5"), @@ -121,7 +121,7 @@ db.team.find({ The output: -```json +```json5 [ { _id: ObjectId("63aa247e69c82de72bd40b93"), @@ -153,7 +153,7 @@ db.team.find({ The output: -```json +```json5 [ { _id: ObjectId("63aa247e69c82de72bd40b92"), diff --git a/website/docs/operators/query/bitwise-operators.md b/website/docs/operators/query/bitwise-operators.md index 198ef72a3577..7187735fb40d 100644 --- a/website/docs/operators/query/bitwise-operators.md +++ b/website/docs/operators/query/bitwise-operators.md @@ -60,7 +60,7 @@ db.numbers.find({ The output: -```json +```json5 [{ "_id": 2, "value": 56, "binaryValue": "111000" }] ``` @@ -92,7 +92,7 @@ db.numbers.find({ The output: -```json +```json5 [ { "_id": 1, "value": 23, "binaryValue": "10111" }, { "_id": 4, "value": 102, "binaryValue": "1100110" } @@ -119,7 +119,7 @@ db.numbers.find({ The output: -```json +```json5 [ { "_id": 2, "value": 56, "binaryValue": "111000" }, { "_id": 3, "value": 67, "binaryValue": "1000011" }, @@ -147,7 +147,7 @@ db.numbers.find({ The output: -```json +```json5 [ { "_id": 1, "value": 23, "binaryValue": "10111" }, { "_id": 3, "value": 67, "binaryValue": "1000011" }, diff --git a/website/docs/operators/query/comparison-operators.md b/website/docs/operators/query/comparison-operators.md index cea1dbf6436a..e4033deffece 100644 --- a/website/docs/operators/query/comparison-operators.md +++ b/website/docs/operators/query/comparison-operators.md @@ -76,7 +76,7 @@ db.employees.find({ The response returns a single document that matches the query: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0e"), @@ -102,7 +102,7 @@ db.employees.find({ The response returns a single document that matches the query: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -133,7 +133,7 @@ db.employees.find({ The output: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -172,7 +172,7 @@ db.employees.find({ The output: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -219,7 +219,7 @@ db.employees.find({ The output: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -259,7 +259,7 @@ db.employees.find({ The output: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0e"), @@ -290,7 +290,7 @@ db.employees.find({ The output: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0d"), @@ -329,7 +329,7 @@ db.employees.find({ The output: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), @@ -369,7 +369,7 @@ db.employees.find({ The output: -```json +```json5 [ { _id: ObjectId("639a3cce071b6bed396a8f0c"), diff --git a/website/docs/operators/query/element-operators.md b/website/docs/operators/query/element-operators.md index e2564066e662..c18d1f105a15 100644 --- a/website/docs/operators/query/element-operators.md +++ b/website/docs/operators/query/element-operators.md @@ -126,7 +126,7 @@ db.electronics.find({ The output: -```json +```json5 [ { _id: ObjectId("63a32fc7cf72d6203bb45b8e"), @@ -196,7 +196,7 @@ db.electronics.find({ The output: -```json +```json5 [ { _id: ObjectId("63a32fc7cf72d6203bb45b8e"), @@ -310,7 +310,7 @@ db.electronics.find({ The output: -```json +```json5 [ { _id: ObjectId("63a32fc7cf72d6203bb45b8e"), diff --git a/website/docs/operators/query/evaluation-operators.md b/website/docs/operators/query/evaluation-operators.md index c038d304b922..3a6b046ecaf0 100644 --- a/website/docs/operators/query/evaluation-operators.md +++ b/website/docs/operators/query/evaluation-operators.md @@ -62,7 +62,7 @@ db.catalog.find({ The output: -```json +```json5 [ { _id: ObjectId("63e3ac0184f488929a3f737a"), @@ -104,7 +104,7 @@ db.catalog.find({ The output: -```json +```json5 [ { _id: ObjectId("63e4ce469695494b86bf2b2d"), @@ -146,7 +146,7 @@ db.catalog.find({ The output: -```json +```json5 [ { _id: ObjectId("63e3ac0184f488929a3f7379"), diff --git a/website/docs/operators/query/logical-operators.md b/website/docs/operators/query/logical-operators.md index 35fd9fdbe3d1..aec278a1fb05 100644 --- a/website/docs/operators/query/logical-operators.md +++ b/website/docs/operators/query/logical-operators.md @@ -106,7 +106,7 @@ db.catalog.find({ The output: -```json +```json5 [ { _id: ObjectId("639ba4a0071b6bed396a8f13"), @@ -170,7 +170,7 @@ db.catalog.find({ The output: -```json +```json5 [ { _id: ObjectId("639ba4a0071b6bed396a8f13"), @@ -228,7 +228,7 @@ db.catalog.find({ The output: -```json +```json5 [ { _id: ObjectId("639ba4a0071b6bed396a8f15"), @@ -292,7 +292,7 @@ db.catalog.find({ The output: -```json +```json5 [ { _id: ObjectId("639ba4a0071b6bed396a8f14"), diff --git a/website/docs/operators/update/array-update-operators.md b/website/docs/operators/update/array-update-operators.md index cf3fb6b99681..129b240cef05 100644 --- a/website/docs/operators/update/array-update-operators.md +++ b/website/docs/operators/update/array-update-operators.md @@ -34,7 +34,7 @@ db.store.updateOne({ _id: 1 }, { $push: { items: 'markers' } }) After the operation, the updated document looks like this: -```json +```json5 [ { "_id": 1, @@ -62,7 +62,7 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { items: 'paper' } }) The document is subsequently updated with the new element, as depicted below: -```json +```json5 [{ "_id": 1, "items": ["pens", "pencils", "paper"] }] ``` @@ -74,7 +74,7 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { items: 'pens' } }) Since the array already contains the element, there won't be any changes. -```json +```json5 [{ "_id": 1, "items": ["pens", "pencils", "paper"] }] ``` @@ -92,7 +92,7 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { colors: 'red' } }) The updated document looks like this: -```json +```json5 [{ "_id": 1, "items": ["pens", "pencils", "paper"], "colors": ["red"] }] ``` @@ -117,7 +117,7 @@ db.products.updateOne({ _id: 1 }, { $pop: { items: -1 } }) The document is subsequently updated with the first element `pens` removed, as depicted below: -```json +```json5 [ { "_id": 1, @@ -134,7 +134,7 @@ db.products.updateOne({ _id: 1 }, { $pop: { items: 1 } }) The updated now looks like this: -```json +```json5 [ { "_id": 1, @@ -166,7 +166,7 @@ db.store.updateOne( After removing all instances of the specified array elements, the document is updated as follows: -```json +```json5 [ { "_id": 1, @@ -210,6 +210,6 @@ db.fruits.update( The updated document now looks like this: -```json +```json5 [{ "_id": 1, "fruits": [{ "type": "orange", "color": "orange" }] }] ``` diff --git a/website/docs/operators/update/field-update-operators.md b/website/docs/operators/update/field-update-operators.md index 33f6df2b05ef..303615272247 100644 --- a/website/docs/operators/update/field-update-operators.md +++ b/website/docs/operators/update/field-update-operators.md @@ -60,7 +60,7 @@ The above query updates the value of the `city` field in the `address` embedded This is the updated document: -```json +```json5 [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -94,7 +94,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $unset: { 'address.zip': '' } }) Below is the updated document, without the `zip` field: -```json +```json5 [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -128,7 +128,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $inc: { age: 1 } }) The updated document looks like this: -```json +```json5 [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -162,7 +162,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $mul: { salary: 1.25 } }) The updated record looks like this: -```json +```json5 [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -195,7 +195,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $rename: { jobTitle: 'title' } }) The updated document looks like this: -```json +```json5 [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -229,7 +229,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $min: { age: 30 } }) Since `30` is less than `36`, the value of the `age` field is updated to `30`. The updated document now looks like this: -```json +```json5 [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -262,7 +262,7 @@ db.employee.updateOne({ name: 'John Doe' }, { $max: { age: 40 } }) This is what the updated document looks like: -```json +```json5 [ { _id: ObjectId("640a603558955e0e2b57c00d"), @@ -296,7 +296,7 @@ db.employee.updateOne( This is the document after the update: -```json +```json5 [ { _id: ObjectId("640a603558955e0e2b57c00d"), diff --git a/website/docusaurus.config-blog.js b/website/docusaurus.config-blog.js index d7bb2eaaa25d..f582971109d7 100644 --- a/website/docusaurus.config-blog.js +++ b/website/docusaurus.config-blog.js @@ -1,8 +1,7 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer').themes.github; -const darkCodeTheme = require('prism-react-renderer').themes.dracula; +import {themes} from 'prism-react-renderer'; /** @type {import('@docusaurus/types').Config} */ const config = { @@ -178,9 +177,9 @@ const config = { copyright: `Copyright © ${new Date().getFullYear()} FerretDB Inc. Built with Docusaurus.`, }, prism: { - theme: lightCodeTheme, - darkTheme: darkCodeTheme, - additionalLanguages: ['go', 'sql', 'json'], + theme: themes.github, + darkTheme: themes.dracula, + additionalLanguages: ['go', 'sql', 'json', 'json5'], }, mermaid: { theme: {light: 'default', dark: 'dark'}, diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 10beae7a6442..667651624a78 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -1,8 +1,7 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer').themes.github; -const darkCodeTheme = require('prism-react-renderer').themes.dracula; +import {themes} from 'prism-react-renderer'; /** @type {import('@docusaurus/types').Config} */ const config = { @@ -140,9 +139,9 @@ const config = { copyright: `Copyright © ${new Date().getFullYear()} FerretDB Inc. Built with Docusaurus.`, }, prism: { - theme: lightCodeTheme, - darkTheme: darkCodeTheme, - additionalLanguages: ['go', 'sql', 'json'], + theme: themes.github, + darkTheme: themes.dracula, + additionalLanguages: ['go', 'sql', 'json', 'json5'], }, mermaid: { theme: {light: 'default', dark: 'dark'}, From 8ee38269bb33406dcc3a2cd0d46be521e3bcdb1f Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Fri, 1 Dec 2023 01:23:08 +0100 Subject: [PATCH 4/9] fix json errors --- ...-11-08-pjson-how-to-store-bson-in-jsonb.md | 2 +- .../2023-05-09-ferretdb-v-1-1-0-released.md | 26 +++---- ...2023-06-19-ferretdb-v-1-4-0-new-release.md | 68 +++++++++---------- .../blog/2023-10-31-mongodb-sorting-scalar.md | 30 ++++---- .../aggregation-pipeline-and-commands.md | 6 +- .../docs/operators/query/bitwise-operators.md | 20 +++--- .../update/array-update-operators.md | 24 +++---- 7 files changed, 88 insertions(+), 88 deletions(-) diff --git a/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md b/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md index 0b96d0bda161..b43a62008f0d 100644 --- a/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md +++ b/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md @@ -33,7 +33,7 @@ In BSON, `\x00` is a byte used as a terminator to indicate the end of a document In BSON, field names use `cstring` which are UTF-8 characters followed by `\x00`. ```json5 -{ "foo": "bar" } +{ foo: 'bar' } ``` | | | diff --git a/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md b/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md index a32e6d00beaa..9013cdac5027 100644 --- a/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md +++ b/website/blog/2023-05-09-ferretdb-v-1-1-0-released.md @@ -73,9 +73,9 @@ The output document looks like this: ```json5 [ { - "_id": 1, - "category": "Electronics", - "inventory": [{ "product": "Laptop", "price": 1200, "quantity": 10 }] + _id: 1, + category: 'Electronics', + inventory: [{ product: 'Laptop', price: 1200, quantity: 10 }] } ] ``` @@ -90,16 +90,16 @@ For instance, if we have a `users` collection as shown below: ```json5 [ { - "_id": 1, - "name": "John", - "age": 30, - "email": "john@example.com" + _id: 1, + name: 'John', + age: 30, + email: 'john@example.com' }, { - "_id": 2, - "name": "Jane", - "age": 25, - "email": "jane@example.com" + _id: 2, + name: 'Jane', + age: 25, + email: 'jane@example.com' } ] ``` @@ -114,8 +114,8 @@ The query will return: ```json5 [ - { "_id": 1, "name": "Anonymous" }, - { "_id": 2, "name": "Anonymous" } + { _id: 1, name: 'Anonymous' }, + { _id: 2, name: 'Anonymous' } ] ``` diff --git a/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md b/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md index 7b0c44a20881..c37b1641fe45 100644 --- a/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md +++ b/website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md @@ -40,16 +40,16 @@ Suppose you have the following document: ```json5 [ { - "_id": 1, - "name": "John", - "age": 35, - "salary": 5000 + _id: 1, + name: 'John', + age: 35, + salary: 5000 }, { - "_id": 2, - "name": "Robert", - "age": 42, - "salary": 7000 + _id: 2, + name: 'Robert', + age: 42, + salary: 7000 } ] ``` @@ -72,8 +72,8 @@ The output will be: ```json5 [ - { "_id": 1, "name": "John", "age": 35, "ageType": "int" }, - { "_id": 2, "name": "Robert", "age": 42, "ageType": "int" } + { _id: 1, name: 'John', age: 35, ageType: 'int' }, + { _id: 2, name: 'Robert', age: 42, ageType: 'int' } ] ``` @@ -102,20 +102,20 @@ The output will be: ```json5 [ { - "_id": 1, - "name": "John", - "age": 35, - "salary": 5000, - "department": "HR", - "employmentType": "Full-time" + _id: 1, + name: 'John', + age: 35, + salary: 5000, + department: 'HR', + employmentType: 'Full-time' }, { - "_id": 2, - "name": "Robert", - "age": 42, - "salary": 7000, - "department": "HR", - "employmentType": "Full-time" + _id: 2, + name: 'Robert', + age: 42, + salary: 7000, + department: 'HR', + employmentType: 'Full-time' } ] ``` @@ -137,18 +137,18 @@ The output: ```json5 [ { - "_id": 1, - "name": "John", - "age": 35, - "salary": 5000, - "department": "Sales" + _id: 1, + name: 'John', + age: 35, + salary: 5000, + department: 'Sales' }, { - "_id": 2, - "name": "Robert", - "age": 42, - "salary": 7000, - "department": "Sales" + _id: 2, + name: 'Robert', + age: 42, + salary: 7000, + department: 'Sales' } ] ``` @@ -167,8 +167,8 @@ Output: ```json5 [ - { "_id": 1, "name": "John", "age": 35 }, - { "_id": 2, "name": "Robert", "age": 42 } + { _id: 1, name: 'John', age: 35 }, + { _id: 2, name: 'Robert', age: 42 } ] ``` diff --git a/website/blog/2023-10-31-mongodb-sorting-scalar.md b/website/blog/2023-10-31-mongodb-sorting-scalar.md index 1b38adc64eb5..904a986b6f91 100644 --- a/website/blog/2023-10-31-mongodb-sorting-scalar.md +++ b/website/blog/2023-10-31-mongodb-sorting-scalar.md @@ -92,11 +92,11 @@ db.outfits.find().sort({ size: 1 }) ```json5 [ - { "_id": 5, "name": "slippers" }, - { "_id": 3, "name": "boots", "size": 8, "color": "black" }, - { "_id": 4, "name": "sneakers", "size": 8.5, "color": "blue" }, - { "_id": 2, "name": "sandals", "size": 9, "color": null }, - { "_id": 1, "name": "flip flops", "size": "M", "color": "blue" } + { _id: 5, name: 'slippers' }, + { _id: 3, name: 'boots', size: 8, color: 'black' }, + { _id: 4, name: 'sneakers', size: 8.5, color: 'blue' }, + { _id: 2, name: 'sandals', size: 9, color: null }, + { _id: 1, name: 'flip flops', size: 'M', color: 'blue' } ] ``` @@ -122,11 +122,11 @@ db.outfits.find().sort({ size: -1 }) ```json5 [ - { "_id": 1, "name": "flip flops", "size": "M", "color": "blue" }, - { "_id": 2, "name": "sandals", "size": 9, "color": null }, - { "_id": 4, "name": "sneakers", "size": 8.5, "color": "blue" }, - { "_id": 3, "name": "boots", "size": 8, "color": "black" }, - { "_id": 5, "name": "slippers" } + { _id: 1, name: 'flip flops', size: 'M', color: 'blue' }, + { _id: 2, name: 'sandals', size: 9, color: null }, + { _id: 4, name: 'sneakers', size: 8.5, color: 'blue' }, + { _id: 3, name: 'boots', size: 8, color: 'black' }, + { _id: 5, name: 'slippers' } ] ``` @@ -151,11 +151,11 @@ db.outfits.find().sort({ color: 1, _id: 1 }) ```json5 [ - { "_id": 2, "name": "sandals", "size": 9, "color": null }, - { "_id": 5, "name": "slippers" }, - { "_id": 3, "name": "boots", "size": 8, "color": "black" }, - { "_id": 1, "name": "flip flops", "size": "M", "color": "blue" }, - { "_id": 4, "name": "sneakers", "size": 8.5, "color": "blue" } + { _id: 2, name: 'sandals', size: 9, color: null }, + { _id: 5, name: 'slippers' }, + { _id: 3, name: 'boots', size: 8, color: 'black' }, + { _id: 1, name: 'flip flops', size: 'M', color: 'blue' }, + { _id: 4, name: 'sneakers', size: 8.5, color: 'blue' } ] ``` diff --git a/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md b/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md index 2b4c9c27c083..129926ec89b0 100644 --- a/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md +++ b/website/docs/aggregation-operations/aggregation-pipeline-and-commands.md @@ -52,9 +52,9 @@ So the above aggregation pipeline operation would return the following result: ```json5 [ - { "_id": "Home", "totalPrice": 2700, "productCount": 2 }, - { "_id": "Clothing", "totalPrice": 80, "productCount": 2 }, - { "_id": "Books", "totalPrice": 60, "productCount": 2 } + { _id: 'Home', totalPrice: 2700, productCount: 2 }, + { _id: 'Clothing', totalPrice: 80, productCount: 2 }, + { _id: 'Books', totalPrice: 60, productCount: 2 } ] ``` diff --git a/website/docs/operators/query/bitwise-operators.md b/website/docs/operators/query/bitwise-operators.md index 7187735fb40d..14a01d1756f5 100644 --- a/website/docs/operators/query/bitwise-operators.md +++ b/website/docs/operators/query/bitwise-operators.md @@ -61,7 +61,7 @@ db.numbers.find({ The output: ```json5 -[{ "_id": 2, "value": 56, "binaryValue": "111000" }] +[{ _id: 2, value: 56, binaryValue: '111000' }] ``` For the same query above, the bitmask can also be written as a BinData value: @@ -94,8 +94,8 @@ The output: ```json5 [ - { "_id": 1, "value": 23, "binaryValue": "10111" }, - { "_id": 4, "value": 102, "binaryValue": "1100110" } + { _id: 1, value: 23, binaryValue: '10111' }, + { _id: 4, value: 102, binaryValue: '1100110' } ] ``` @@ -121,9 +121,9 @@ The output: ```json5 [ - { "_id": 2, "value": 56, "binaryValue": "111000" }, - { "_id": 3, "value": 67, "binaryValue": "1000011" }, - { "_id": 4, "value": 102, "binaryValue": "1100110" } + { _id: 2, value: 56, binaryValue: '111000' }, + { _id: 3, value: 67, binaryValue: '1000011' }, + { _id: 4, value: 102, binaryValue: '1100110' } ] ``` @@ -149,10 +149,10 @@ The output: ```json5 [ - { "_id": 1, "value": 23, "binaryValue": "10111" }, - { "_id": 3, "value": 67, "binaryValue": "1000011" }, - { "_id": 4, "value": 102, "binaryValue": "1100110" }, - { "_id": 5, "value": 5, "binaryValue": "101" } + { _id: 1, value: 23, binaryValue: '10111' }, + { _id: 3, value: 67, binaryValue: '1000011' }, + { _id: 4, value: 102, binaryValue: '1100110' }, + { _id: 5, value: 5, binaryValue: '101' } ] ``` diff --git a/website/docs/operators/update/array-update-operators.md b/website/docs/operators/update/array-update-operators.md index 129b240cef05..6c7c6df4bad7 100644 --- a/website/docs/operators/update/array-update-operators.md +++ b/website/docs/operators/update/array-update-operators.md @@ -37,8 +37,8 @@ After the operation, the updated document looks like this: ```json5 [ { - "_id": 1, - "items": ["pens", "pencils", "paper", "erasers", "rulers", "markers"] + _id: 1, + items: ['pens', 'pencils', 'paper', 'erasers', 'rulers', 'markers'] } ] ``` @@ -63,7 +63,7 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { items: 'paper' } }) The document is subsequently updated with the new element, as depicted below: ```json5 -[{ "_id": 1, "items": ["pens", "pencils", "paper"] }] +[{ _id: 1, items: ['pens', 'pencils', 'paper'] }] ``` **Example:** Use the `$addToSet` operator to update the array with already existing elements. @@ -75,7 +75,7 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { items: 'pens' } }) Since the array already contains the element, there won't be any changes. ```json5 -[{ "_id": 1, "items": ["pens", "pencils", "paper"] }] +[{ _id: 1, items: ['pens', 'pencils', 'paper'] }] ``` :::note @@ -93,7 +93,7 @@ db.store.updateOne({ _id: 1 }, { $addToSet: { colors: 'red' } }) The updated document looks like this: ```json5 -[{ "_id": 1, "items": ["pens", "pencils", "paper"], "colors": ["red"] }] +[{ _id: 1, items: ['pens', 'pencils', 'paper'], colors: ['red'] }] ``` ## $pop @@ -120,8 +120,8 @@ The document is subsequently updated with the first element `pens` removed, as d ```json5 [ { - "_id": 1, - "items": ["pencils", "paper", "erasers", "rulers"] + _id: 1, + items: ['pencils', 'paper', 'erasers', 'rulers'] } ] ``` @@ -137,8 +137,8 @@ The updated now looks like this: ```json5 [ { - "_id": 1, - "items": ["pencils", "paper", "erasers"] + _id: 1, + items: ['pencils', 'paper', 'erasers'] } ] ``` @@ -169,8 +169,8 @@ After removing all instances of the specified array elements, the document is up ```json5 [ { - "_id": 1, - "items": ["erasers", "rulers"] + _id: 1, + items: ['erasers', 'rulers'] } ] ``` @@ -211,5 +211,5 @@ db.fruits.update( The updated document now looks like this: ```json5 -[{ "_id": 1, "fruits": [{ "type": "orange", "color": "orange" }] }] +[{ _id: 1, fruits: [{ type: 'orange', color: 'orange' }] }] ``` From 81b5736e7cdac84a52cdb4d20c0a8caafe0ab8ed Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Fri, 1 Dec 2023 01:25:47 +0100 Subject: [PATCH 5/9] add extra line --- build/deps/docusaurus-docs.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/docusaurus-docs.Dockerfile b/build/deps/docusaurus-docs.Dockerfile index d5fa4e7e71c2..f66a0b4e8494 100644 --- a/build/deps/docusaurus-docs.Dockerfile +++ b/build/deps/docusaurus-docs.Dockerfile @@ -1 +1 @@ -FROM ghcr.io/ferretdb/docusaurus-docs:3.0.0-1 \ No newline at end of file +FROM ghcr.io/ferretdb/docusaurus-docs:3.0.0-1 From d85ed966cb6f2c9b2fa8c14c5b8b9db87a4b50ad Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Fri, 1 Dec 2023 11:38:50 +0100 Subject: [PATCH 6/9] switch line to JSON --- website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md b/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md index b43a62008f0d..9e8f23ad6b4d 100644 --- a/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md +++ b/website/blog/2022-11-08-pjson-how-to-store-bson-in-jsonb.md @@ -32,8 +32,8 @@ Here the hexadecimal `\x00` notation represents `0000 0000` in bits and similarl In BSON, `\x00` is a byte used as a terminator to indicate the end of a document. In BSON, field names use `cstring` which are UTF-8 characters followed by `\x00`. -```json5 -{ foo: 'bar' } +```json +{ "foo": "bar" } ``` | | | From cc3eb0343fad8274da53cdf2215acebc4fc6e380 Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Fri, 1 Dec 2023 11:51:35 +0100 Subject: [PATCH 7/9] add markdown rule --- build/.markdownlint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/build/.markdownlint.yml b/build/.markdownlint.yml index 30d9d8950f1a..2181f020df9e 100644 --- a/build/.markdownlint.yml +++ b/build/.markdownlint.yml @@ -12,3 +12,4 @@ MD006: false # deprecated MD013: false # we use https://sembr.org that could lead to long lines MD026: { punctuation: ".,;:。,;:" } # default is .,;:!。,;:! MD029: { style: ordered } +MD034: false # autolink tags no longer supported by MDX From 31cc585845eec0cb9484fb54ceaa9a2d439857c0 Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Fri, 1 Dec 2023 13:38:20 +0100 Subject: [PATCH 8/9] Allow bare urls --- website/docs/configuration/flags.md | 15 ++++++--------- website/docs/quickstart-guide/go.md | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/website/docs/configuration/flags.md b/website/docs/configuration/flags.md index b5a1124df435..44950a1cff41 100644 --- a/website/docs/configuration/flags.md +++ b/website/docs/configuration/flags.md @@ -40,9 +40,6 @@ Some default values are overridden in [our Docker image](../quickstart-guide/doc | `--listen-tls-key-file` | TLS key file path | `FERRETDB_LISTEN_TLS_KEY_FILE` | | | `--listen-tls-ca-file` | TLS CA file path | `FERRETDB_LISTEN_TLS_CA_FILE` | | | `--proxy-addr` | Proxy address | `FERRETDB_PROXY_ADDR` | | -| `--proxy-tls-cert-file` | Proxy TLS cert file path | `FERRETDB_PROXY_TLS_CERT_FILE` | | -| `--proxy-tls-key-file` | Proxy TLS key file path | `FERRETDB_PROXY_TLS_KEY_FILE` | | -| `--proxy-tls-ca-file` | Proxy TLS CA file path | `FERRETDB_PROXY_TLS_CA_FILE` | | | `--debug-addr` | Listen address for HTTP handlers for metrics, pprof, etc
(set to `-` to disable) | `FERRETDB_DEBUG_ADDR` | `127.0.0.1:8088`
(`:8088` for Docker) | ## Backend handlers @@ -61,9 +58,9 @@ Some default values are overridden in [our Docker image](../quickstart-guide/doc FerretDB uses [pgx v5](https://github.com/jackc/pgx) library for connecting to PostgreSQL. Supported URL parameters are documented there: -- [https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#ParseConfig](https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#ParseConfig) -- [https://pkg.go.dev/github.com/jackc/pgx/v5#ParseConfig](https://pkg.go.dev/github.com/jackc/pgx/v5#ParseConfig) -- [https://pkg.go.dev/github.com/jackc/pgx/v5/pgxpool#ParseConfig](https://pkg.go.dev/github.com/jackc/pgx/v5/pgxpool#ParseConfig) +- https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#ParseConfig +- https://pkg.go.dev/github.com/jackc/pgx/v5#ParseConfig +- https://pkg.go.dev/github.com/jackc/pgx/v5/pgxpool#ParseConfig Additionally: @@ -83,9 +80,9 @@ Additionally: FerretDB uses [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) library for accessing SQLite database files. Supported URL parameters are documented there: -- [https://www.sqlite.org/uri.html](https://www.sqlite.org/uri.html) -- [https://pkg.go.dev/modernc.org/sqlite#Driver.Open](https://pkg.go.dev/modernc.org/sqlite#Driver.Open) -- [https://www.sqlite.org/pragma.html](https://www.sqlite.org/pragma.html) +- https://www.sqlite.org/uri.html +- https://pkg.go.dev/modernc.org/sqlite#Driver.Open +- https://www.sqlite.org/pragma.html Additionally: diff --git a/website/docs/quickstart-guide/go.md b/website/docs/quickstart-guide/go.md index c9583b6d5a49..c3a5c313aa29 100644 --- a/website/docs/quickstart-guide/go.md +++ b/website/docs/quickstart-guide/go.md @@ -4,7 +4,7 @@ sidebar_position: 6 # Go -See [https://pkg.go.dev/github.com/FerretDB/FerretDB/ferretdb](https://pkg.go.dev/github.com/FerretDB/FerretDB/ferretdb). +See https://pkg.go.dev/github.com/FerretDB/FerretDB/ferretdb. _This section is not currently available. You can help FerretDB by contributing to this section. From aab3b9117d43c56453f6663afb6f2f87db8566db Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Fri, 1 Dec 2023 14:00:16 +0100 Subject: [PATCH 9/9] fix missing code --- website/docs/configuration/flags.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/docs/configuration/flags.md b/website/docs/configuration/flags.md index 44950a1cff41..aaaca18df10d 100644 --- a/website/docs/configuration/flags.md +++ b/website/docs/configuration/flags.md @@ -40,6 +40,9 @@ Some default values are overridden in [our Docker image](../quickstart-guide/doc | `--listen-tls-key-file` | TLS key file path | `FERRETDB_LISTEN_TLS_KEY_FILE` | | | `--listen-tls-ca-file` | TLS CA file path | `FERRETDB_LISTEN_TLS_CA_FILE` | | | `--proxy-addr` | Proxy address | `FERRETDB_PROXY_ADDR` | | +| `--proxy-tls-cert-file` | Proxy TLS cert file path | `FERRETDB_PROXY_TLS_CERT_FILE` | | +| `--proxy-tls-key-file` | Proxy TLS key file path | `FERRETDB_PROXY_TLS_KEY_FILE` | | +| `--proxy-tls-ca-file` | Proxy TLS CA file path | `FERRETDB_PROXY_TLS_CA_FILE` | | | `--debug-addr` | Listen address for HTTP handlers for metrics, pprof, etc
(set to `-` to disable) | `FERRETDB_DEBUG_ADDR` | `127.0.0.1:8088`
(`:8088` for Docker) | ## Backend handlers