typesense / typesense-js

JavaScript / TypeScript client for Typesense
https://typesense.org/docs/api
Apache License 2.0
393 stars 74 forks source link

400 error with update(..., { filter_by }) #170

Closed jdriscoll98 closed 1 year ago

jdriscoll98 commented 1 year ago

Description

Getting an error when trying out "Update by query" function from v0.25.0

RequestMalformed: Request failed with HTTP code 400 | Server said: For update, the id key must be provided.

Steps to reproduce

Here is my code:

  let document = {
    seller_type: 'dealer',
  };
  await client.collections('products_alias').documents().update(document, {
    filter_by: `seller_id:=${id}`,
  });

Expected Behavior

To update all documents that match a given filter_by query:

Actual Behavior

RequestMalformed: Request failed with HTTP code 400 | Server said: For update, the id key must be provided.

Metadata

Typesense Version: v0.25.0 Typesense JS Version: v1.7.1

OS: Mac Ventura 13.2.1

jasonbosco commented 1 year ago

This is a duplicate of https://github.com/typesense/typesense/issues/1165. Will fix it shortly.

jdriscoll98 commented 1 year ago

@jasonbosco Thank you! I'll close this one and follow that