Skip to content

Commit aaa29bc

Browse files
committed
Remove dollar signs from code examples
1 parent e38b8e6 commit aaa29bc

File tree

8 files changed

+52
-34
lines changed

8 files changed

+52
-34
lines changed

.code-samples.meilisearch.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ getting_started_add_documents_md: |-
290290
```bash
291291
npm install meilisearch
292292
```
293-
Or
293+
294+
Or, if you are using `yarn`
294295
```bash
295296
yarn add meilisearch
296297
```

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ First of all, thank you for contributing to MeiliSearch! The goal of this docume
3333
### Setup
3434

3535
```bash
36-
$ yarn --dev
36+
yarn --dev
3737
```
3838

3939
### Tests and Linter
@@ -42,15 +42,15 @@ Each PR should pass the tests and the linter to be accepted.
4242

4343
```bash
4444
# Tests
45-
$ docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
46-
$ docker run -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
47-
$ yarn test
45+
docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
46+
docker run -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
47+
yarn test
4848
# Linter
49-
$ yarn style
49+
yarn style
5050
# Linter with fixing
51-
$ yarn style:fix
51+
yarn style:fix
5252
# Build the project
53-
$ yarn build
53+
yarn build
5454
```
5555

5656
## Git Guidelines

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ There are many easy ways to [download and run a MeiliSearch instance](https://do
6262
For example, if you use Docker:
6363

6464
```bash
65-
$ docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
66-
$ docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey
65+
docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
66+
docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey
6767
```
6868

6969
NB: you can also download MeiliSearch from **Homebrew** or **APT**.

examples/browser/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Build the base project `/meilisearch-js` as this example uses the locally build bundles from `meilisearch-js`.
66

77
```
8-
$ cd meilisearch-js
9-
$ yarn build
8+
cd meilisearch-js
9+
yarn build
1010
```
1111

1212
## Credentials

examples/node/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Build the base project `/meilisearch-js` as this example uses the locally build bundles from `meilisearch-js`.
66

77
```
8-
$ cd meilisearch-js
9-
$ yarn build
8+
cd meilisearch-js
9+
yarn build
1010
```
1111

1212
## Credentials

examples/node/small_index.js

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,44 @@ const client = new MeiliSearch(config)
1010
const uid = 'movies_test'
1111

1212
const dataset = [
13-
{ id: 123, title: 'Pride and Prejudice', comment: 'A great book' },
13+
{ biduleidbidule: "ahaha", id: 123, title: 'Pride and Prejudice', comment: 'A great book' },
1414
{
15+
biduleidbidule: "ahaha2",
1516
id: 456,
1617
title: 'Le Petit Prince',
1718
comment: 'A french book about a prince that walks on little cute planets',
1819
},
19-
{ id: 2, title: 'Le Rouge et le Noir', comment: 'Another french book' },
20-
{ id: 1, title: 'Alice In Wonderland', comment: 'A weird book' },
21-
{ id: 1344, title: 'The Hobbit', comment: 'An awesome book' },
20+
{ biduleidbidule: "ahaha3", id: 2, title: 'Le Rouge et le Noir', comment: 'Another french book' },
21+
{ biduleidbidule: "ahaha4", id: 1, title: 'Alice In Wonderland', comment: 'A weird book' },
22+
{ biduleidbidule: "ahaha5", id: 1344, title: 'The Hobbit', comment: 'An awesome book' },
2223
{
24+
biduleidbidule: "ahaha6",
2325
id: 4,
2426
title: 'Harry Potter and the Half-Blood Prince',
2527
comment: 'The best book',
2628
},
27-
{ id: 42, title: "The Hitchhiker's Guide to the Galaxy" },
29+
{ biduleidbidule: "ahaha7", id: 42, title: "The Hitchhiker's Guide to the Galaxy" },
2830
]
2931

3032
;(async () => {
31-
// This example creates an index with 7 documents
32-
const index = await client.getOrCreateIndex(uid)
33-
const { updateId } = await index.addDocuments(dataset)
34-
const res = await index.waitForPendingUpdate(updateId)
35-
console.log({ res })
33+
try {
34+
// This example creates an index with 7 documents
35+
// console.log(await client.getKeys())
36+
await client.deleteIndex(uid)
37+
const index = await client.getOrCreateIndex(uid, {
38+
// primaryKey: "id"
39+
})
40+
// const update = await client.updateIndex(uid, {
41+
// primaryKey: "test_id"
42+
// })
43+
const { updateId } = await index.addDocuments(dataset)
44+
const res = await index.waitForPendingUpdate(updateId)
45+
// console.log({ res })
46+
// const docs = await index.search("harry")
47+
// console.log(docs.hits)
48+
const i = await client.index(uid).getRawInfo()
49+
console.log(i)
50+
} catch(e) {
51+
console.log(e)
52+
}
3653
})()

examples/typescript-browser/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Build the base project `/meilisearch-js` as this example uses the locally build bundles from `meilisearch-js`.
66

77
```
8-
$ cd meilisearch-js
9-
$ yarn build
8+
cd meilisearch-js
9+
yarn build
1010
```
1111

1212
## Credentials
@@ -22,19 +22,19 @@ To try it out you need to follow these steps.
2222
### 1. Install dependencies
2323

2424
```bash
25-
$ yarn
25+
yarn
2626
```
2727

2828
### 2. Build
2929

3030
```bash
31-
$ yarn build
31+
yarn build
3232
```
3333

3434
### 3. Serve
3535

3636
```bash
37-
$ http-server public
37+
http-server public
3838
```
3939

4040
We used http-server CLI to serve the webpage. Feel free to use any tool with the same purpose as it will not impact the result.

examples/typescript-node/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Build the base project `/meilisearch-js` as this example uses the locally build bundles from `meilisearch-js`.
66

77
```
8-
$ cd meilisearch-js
9-
$ yarn build
8+
cd meilisearch-js
9+
yarn build
1010
```
1111

1212
## Credentials
@@ -22,17 +22,17 @@ To try it out you need to follow these steps:
2222
### 1. Install dependencies
2323

2424
```bash
25-
$ yarn
25+
yarn
2626
```
2727

2828
### 2. Build
2929

3030
```bash
31-
$ yarn build
31+
yarn build
3232
```
3333

3434
### 3. Execute
3535

3636
```bash
37-
$ node build/bundle.js
37+
node build/bundle.js
3838
```

0 commit comments

Comments
 (0)