在测试中模拟/生成 Cognito 令牌的最佳方法是什么?
我有一个设置授权标头的辅助函数:
const response = await request(service)
.post('/graphql')
.send({ query, variables })
.set('Authorization', `Bearer ${token}`)
Run Code Online (Sandbox Code Playgroud)
似乎我需要自己生成令牌,但我不确定如何或是否可以这样做。
我正在尝试从一jsonb列中删除多个键。
我设法通过以下语句删除单个键:
UPDATE table_a
SET data_column = data_column #- '{attr_1}'
WHERE type = 'type_a'
Run Code Online (Sandbox Code Playgroud)
我知道这是一条路径,所以我不能这样做:
#- '{attr_1,attr_2}
根据文档,我也应该能够做,- 'attr_1'但是那没有用,否则我会尝试尝试- 'attr_1,attr2'