我想在 azure 中加密一些 blob,并且我正在使用 Streams API。我正在从容器中读取 blob 存储,并尝试将加密的 blob 推送到其他容器中。
尽管new ReadableStream()的实例已被识别,但我还是记录了错误“ReadableStream 未定义” 任何对此的帮助,我们都非常欢迎!
代码
const { BlobServiceClient } = require('@azure/storage-blob');
const openpgp = require('openpgp');
const {privateKey, publicKey} = require('./keys')
async function main() {
const AZURE_STORAGE_CONNECTION_STRING = process.env.AZURE_STORAGE_CONNECTION_STRING;
const blobServiceClient = BlobServiceClient.fromConnectionString(AZURE_STORAGE_CONNECTION_STRING);
const containerClient = blobServiceClient.getContainerClient("uploadebs");
const containerEncryptedFiles = blobServiceClient.getContainerClient("encrypted-dide");
await containerEncryptedFiles.createIfNotExists("encrypted-dide")
// RSA keys
// console.log(`private key => ${privateKey}`)
// console.log(`public key => ${publicKey}`)
// .then((keyPair) => {console.log(`${JSON.stringify(keyPair)}` )}).catch((error) => console.log(`error in generating the keys: ${error}`));
for await …Run Code Online (Sandbox Code Playgroud) 我不知道如何使用 TypeOrm Query Builder 编写以下 MySql 语句
SELECT reg.id FROM farm.reg WHERE grpId = 'ABC';
此选择仅返回 ID,但我的查询构建器正在返回整个对象。
在这一刻,我的 NestJs 服务中有这个功能,但我需要使用“地图”,我不想......
async getGrupIds(entity: string, grpId: string) {
console.log(entity, grpId);
const ids = await getRepository(reg)
.createQueryBuilder(entity)
.where('reg.grpId = :grpId', {grpId: grpId})
.getMany();
console.log(ids);
return ids.map(o => o.id);
}
Run Code Online (Sandbox Code Playgroud)
谢谢