Skip to content

Commit 842e95e

Browse files
bors[bot]bidoubiwa
andauthored
Merge #1055
1055: Change naming of updateDocumentInBatch to Batches r=bidoubiwa a=bidoubiwa Fixes naming error introduced in: #1039 Co-authored-by: cvermand <[email protected]>
2 parents 3c26cbd + 8c1b44e commit 842e95e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,15 +402,15 @@ Or using the index object:
402402

403403
- [Add or replace multiple documents in batches](https://docs.meilisearch.com/reference/api/documents.html#add-or-replace-documents):
404404

405-
`index.addDocumentsInBatch(documents: Document<T>[], batchSize = 1000): Promise<EnqueuedUpdate[]>`
405+
`index.addDocumentsInBatches(documents: Document<T>[], batchSize = 1000): Promise<EnqueuedUpdate[]>`
406406

407407
- [Add or update multiple documents](https://docs.meilisearch.com/reference/api/documents.html#add-or-update-documents):
408408

409409
`index.updateDocuments(documents: Document<T>[]): Promise<EnqueuedUpdate>`
410410

411411
- [Add or update multiple documents in batches](https://docs.meilisearch.com/reference/api/documents.html#add-or-update-documents):
412412

413-
`index.updateDocumentsInBatch(documents: Document<T>[], batchSize = 1000): Promise<EnqueuedUpdate[]>`
413+
`index.updateDocumentsInBatches(documents: Document<T>[], batchSize = 1000): Promise<EnqueuedUpdate[]>`
414414

415415
- [Get Documents](https://docs.meilisearch.com/reference/api/documents.html#get-documents):
416416

src/lib/indexes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ class Index<T = Record<string, any>> {
319319
/**
320320
* Add or replace multiples documents to an index in batches
321321
* @memberof Index
322-
* @method addDocumentsInBatch
322+
* @method addDocumentsInBatches
323323
*/
324-
async addDocumentsInBatch(
324+
async addDocumentsInBatches(
325325
documents: Array<Document<T>>,
326326
batchSize = 1000,
327327
options?: AddDocumentParams
@@ -353,7 +353,7 @@ class Index<T = Record<string, any>> {
353353
* @memberof Index
354354
* @method updateDocuments
355355
*/
356-
async updateDocumentsInBatch(
356+
async updateDocumentsInBatches(
357357
documents: Array<Document<T>>,
358358
batchSize = 1000,
359359
options?: AddDocumentParams

tests/documents_tests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe.each([
7474
test(`${permission} key: Add documents to uid with primary key in batch`, async () => {
7575
const response: EnqueuedUpdate[] = await client
7676
.index(indexPk.uid)
77-
.addDocumentsInBatch(dataset, 4)
77+
.addDocumentsInBatches(dataset, 4)
7878
expect(response).toBeInstanceOf(Array)
7979
expect(response).toHaveLength(2)
8080
expect(response[0]).toHaveProperty('updateId', expect.any(Number))
@@ -227,7 +227,7 @@ describe.each([
227227
test(`${permission} key: Update document from index that has a primary key in batch`, async () => {
228228
const response: EnqueuedUpdate[] = await client
229229
.index(indexPk.uid)
230-
.updateDocumentsInBatch(dataset, 2)
230+
.updateDocumentsInBatches(dataset, 2)
231231
expect(response).toBeInstanceOf(Array)
232232
expect(response).toHaveLength(4)
233233
expect(response[0]).toHaveProperty('updateId', expect.any(Number))

0 commit comments

Comments
 (0)