我想把serverNames的类型设置为一个字符串数组,但在watermelon中它只支持布尔值,字符串和数字,有人能帮我吗?
export const settingSchema = tableSchema({
name: 'SETTINGS',
columns: [
{ name: 'serverId', type: 'number' },
{ name: 'server', type: 'string' },
{ name: 'base_url', type: 'string' },
{ name: 'serverNames', type: 'string', },//<-----serverNames,type:'[string]
{ name: 'amberIcon', type: 'boolean' },
{ name: 'showAllResident', type: 'boolean' },
{ name: 'showAllTask', type: 'boolean' },
{ name: 'filterStart', type: 'number' },
{ name: 'filterEnd', type: 'number' },
{ name: 'searchedText', type: 'string' },
{ name: 'currentTab', type: 'number' },
{ name: 'appInit', type: 'boolean' },
{ name: 'performRefresh', type: 'boolean' },
{ name: 'slowMessageDisplay', type: 'boolean' },
{ name: 'backgroundListener', type: 'boolean' },
{ name: 'displayResidentHeader', type: 'boolean' },
{ name: 'currentResident', type: 'string', isOptional: true },
]
})
2条答案
按热度按时间ocebsuys1#
你可以使用JSON字段类型,我相信。https://nozbe.github.io/WatermelonDB/Advanced/AdvancedFields.html#json
km0tfn4u2#
**更新2023年10月 *
使用新的url文档here