#community-help

Handling nil Value in Geopoint Type in Typesense

TLDR Bhola was encountering a problem with storing a nil value in Geopoint type in Typesense. Jason suggested setting the field as optional: true in the schema and then omitting the field entirely in the document.

Powered by Struct AI

1

2
11mo
Solved
Join the chat
Nov 11, 2022 (11 months ago)
Bhola
Photo of md5-d7f4aa44e3d4866e8b7a38eceb9af762
Bhola
03:40 AM
Hey guys,
i facing issue with the geopoint type in typesense
just i have one doubt we can not store nil value in the geopoint ?
when i am trying to store nil value like :- geo_data=>[nil, nil]
it give me error Typesense::Error::RequestMalformed: Field geo_data must be a geopoint
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:50 AM
You would have to set that field as optional: true in the schema, and then leave the field out of the document completely

1