cloudfunctions/ClearingRedundantFolders/node_modules/tcb-admin-node/node_modules/@cloudbase/database/dist/esm/index.js
(完整代码) 1KBimport * as Geo from './geo/index';
import { CollectionReference } from './collection';
import { Command } from './command';
import { ServerDateConstructor } from './serverDate/index';
import { RegExpConstructor } from './regexp/index';
import { startTransaction, runTransaction } from './transaction/index';
import { LogicCommand } from './commands/logic';
import { QueryCommand } from './commands/query';
import { UpdateCommand } from './commands/update';
export { Query } from './query';
export { CollectionReference } from './collection';
export { DocumentReference } from './document';
export class Db {
constructor(config) {
this.config = config;
this.Geo = Geo;
this.serverDate = ServerDateConstructor;
this.command = Command;
this.RegExp = RegExpConstructor;
this.startTransaction = startTransaction;
this.runTransaction = runTransaction;
this.logicCommand = LogicCommand;
this.updateCommand = UpdateCommand;
this.queryCommand = QueryCommand;
}
collection(collName) {
if (!collName) {
throw new Error('Collection name is required');
}
return new CollectionReference(this, collName);
}
createCollection(collName) {
let request = new Db.reqClass(this.config);
const params = {
collectionName: collName
};
return request.send('database.addCollection', params);
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
