convertNumberField converts a single numeric field to string format
(data map[string]interface{}, field string)
| 328 | |
| 329 | // convertNumberField converts a single numeric field to string format |
| 330 | func (t *TypesenseClient) convertNumberField(data map[string]interface{}, field string) { |
| 331 | if val, ok := data[field]; ok { |
| 332 | switch v := val.(type) { |
| 333 | case *big.Int: |
| 334 | data[field] = v.String() |
| 335 | case float64: |
| 336 | // Convert scientific notation back to integer string |
| 337 | data[field] = fmt.Sprintf("%.0f", v) |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | // ensureSchemaFields ensures all required schema fields are present with default values |
| 343 | func (t *TypesenseClient) ensureSchemaFields(config CollectionConfig, data map[string]interface{}) { |
no outgoing calls