Hello, I have a strange problem when creating / up...
# community-help
p
Hello, I have a strange problem when creating / upserting documents. I set the 'id' field manually in the submitted data to something like 'products_1234' but Typesense ignores it and autogenerates sequential ids like 0, 1, 2, etc. I can see both
id: 0
and
id: post-1234
in typesense-admin. Any ideas what I might be doing wrong ?
j
Could you share a gist like this that replicates the issue: https://gist.github.com/jasonbosco/7c3432713216c378472f13e72246f46b
p
Turns out if the 'id' is the last element of the document array it works.
j
Array?
Document needs to be a JSON object, with a field of
id
p
I'm using PHP and sending the document data in an array
j
Associative arrays in PHP, got it - those are equivalent to JSON objects
so the order inside an associative array shouldn't matter technically
Could you try printing the json encoded version of the associative array and see what's different between the version that works and doesn't work, at the JSON level?
p
2 secs
Hum I can't reproduce the bug, guess it was something else
🤷‍♂️
j
Heisenbug!