i'm getting code 400 error from typesense while in...
# community-help
s
i'm getting code 400 error from typesense while indexing ...because some of my fields some time returns null ....what should i do, i set them as string in typesense schema but some of are saved as null in db
j
We addressed this in a recent RC build. What version of Typesense are you running?
s
0.12.1
should i upgrade
j
Oh yes!
0.21.0.rc24
is the latest version
The workaround for previous versions is to remove null fields from the document fully
s
btw ..sorry but how do i install that rc version .....i tried this method i found ....didn't work 😅
j
Oh I was talking about Typesense Server version. Those instructions are for typesense-js
Are you self hosting or using Typesense Cloud?
s
i'm using docker ...as in self hosting
j
What's the docker command you're using to start Typesense?
s
Copy code
docker run -i -p 8108:8108 -v /tmp/typesense-data/:/data -v /tmp/typesense-logs/:/logs  typesense/typesense:0.20.0 --data-dir /data  --log-dir /logs  --api-key=xyz --listen-port 8108 --enable-cors
j
typesense/typesense:0.20.0
You want to change that to typesense/typesense:0.21.0.rc24
and re-run that command
s
ohh ....silly me
its the same even after using
0.21.0.rc24
...gives 400error and says `error: 'Field
skill
must be a string.',`
message has been deleted
j
Could you share the schema and a sample document (JSON) that failed?
s
yes sure
rating is null for this one ....but in schema i set it as int32
g
I have the same issue. For now I have replaced my null values with undefined values. Also I have set as optional the field that can be nullish.
s
@gab gab so set as undefined and optional ...does it affect your searching with typesense
j
Oh you want to set fields that can be null as
optional: true
in the collection schema
s
ohh thanks @Jason Bosco
g
I mean if I try to index a null value with a field that has (optional:true) it will give me an error 400. Is that intended behavior?
j
That used to be the case with v0.20.0. We've fixed that case in the most recent RC build: v0.21.0.rc24