getDefaultValue returns the default value for a given field type in Typesense.
(fieldType string)
| 505 | |
| 506 | // getDefaultValue returns the default value for a given field type in Typesense. |
| 507 | func getDefaultValue(fieldType string) interface{} { |
| 508 | switch fieldType { |
| 509 | case "string": |
| 510 | return "" |
| 511 | case "int32", "int64": |
| 512 | return int64(0) |
| 513 | case "float": |
| 514 | return float64(0) |
| 515 | case "bool": |
| 516 | return false |
| 517 | case "string[]": |
| 518 | return []string{} |
| 519 | default: |
| 520 | return nil |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | // getLedgerSchema returns the schema for the "ledgers" collection. |
| 525 | func getLedgerSchema() *api.CollectionSchema { |
no outgoing calls