Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docusaurus to v3 #3772

Merged
merged 13 commits into from
Dec 1, 2023
Prev Previous commit
Next Next commit
update codeblock from json5 to json
  • Loading branch information
Fashander committed Nov 30, 2023
commit 209878a16d4305d89b20eb8cbcd43fdbb436d525
Original file line number Diff line number Diff line change
Expand Up @@ -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
AlekSi marked this conversation as resolved.
Show resolved Hide resolved
[{ _id: ObjectId("63aa97626786637ef1c4b725"), active: false }]
```

Expand Down
32 changes: 16 additions & 16 deletions website/blog/2023-05-09-ferretdb-v-1-1-0-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }]
}
]
```
Expand All @@ -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"
}
]
```
Expand All @@ -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" }
]
```

Expand Down
76 changes: 41 additions & 35 deletions website/blog/2023-06-19-ferretdb-v-1-4-0-new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
```
Expand All @@ -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" }
]
```

Expand All @@ -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"
}
]
```
Expand All @@ -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"
}
]
```
Expand All @@ -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 }
]
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ db.demo.find()

Output:

```json5
```json
[
{
_id: ObjectId("648bc0619df6027209a65b40"),
Expand Down
2 changes: 1 addition & 1 deletion website/blog/2023-07-28-grafana-monitoring-ferretdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions website/blog/2023-10-31-mongodb-sorting-scalar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
```

Expand All @@ -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" }
]
```

Expand All @@ -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" }
]
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
]
```

Expand Down
4 changes: 2 additions & 2 deletions website/docs/basic-operations/read.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ db.employees.find({ catalog: 'printer' })

The response displays all the retrieved documents:

```json5
```json
[
{
_id: ObjectId("636b39f80466c61a229bbf9b"),
Expand Down Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion website/docs/contributing/writing-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
10 changes: 5 additions & 5 deletions website/docs/indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading
Loading