Babin
03/17/2023, 2:16 AMBabin
03/17/2023, 2:17 AMBabin
03/17/2023, 2:22 AM"fields": [
{ "name": "id", "type": "string", "index": true },
{ "name": "sku", "type": "string", "index": true, "sort": true, "infix": true, "facet": true },
{ "name": "description", "type": "string", "index": true, "sort": true, "infix": true, "optional": true },
{ "name": "categoryId", "type": "string", "index": true, "optional": true, "facet": true },
...
I load id/sku/description from first source. Let's say 50K documents
Now I want to update categoryId from different source for applicable sku.
curl "${TYPE_SENSE_HOSTURL}/collections/${2}/documents/import?action=update
my JSONL
{"sku":"00010121","categoryId":"200", "subCategoryId":"2010"}
{"sku":"00010464","categoryId":"300", "subCategoryId":"3070"}
{"sku":"00010715","categoryId":"300", "subCategoryId":"3070"}
{"sku":"00010721","categoryId":"300", "subCategoryId":"3070"}
However we get error
{"code":400,"document":"{\"sku\":\"00010121\",\"categoryId\":\"200\", \"subCategoryId\":\"2010\"}\r","error":"For update, the id
key must be provided.","success":false}
{"code":400,"document":"{\"sku\":\"00010464\",\"categoryId\":\"300\", \"subCategoryId\":\"3070\"}\r","error":"For update, the id
key must be provided.","success":false}
Q1# do I have to update only on Id
field
Q2# Can I update with sku
fields? in both curl and sdk ?
Appreciate your time and helpJason Bosco
03/17/2023, 2:55 AMJason Bosco
03/17/2023, 2:56 AM{"id: 123, "sku":"00010121","categoryId":"200", "subCategoryId":"2010"}
That means, in the record with id: 123
, update sku to 00010121
, categoryId to 200, subCategoryId to 2010
Babin
03/17/2023, 3:00 AMupdate-where
?Jason Bosco
03/17/2023, 3:01 AMBabin
03/17/2023, 3:01 AMJason Bosco
03/17/2023, 5:03 AMJason Bosco
03/17/2023, 5:04 AM