UNPKG

@nestjs/mongoose

Version:

MongoDB for NestJS through Mongoose: schemas as decorated classes, injectable models, hooks and multiple connections.

14 lines • 519 B
import { TypeMetadataStorage } from '../storages/type-metadata.storage.js'; export function Virtual(options) { return (target, propertyKey) => { TypeMetadataStorage.addVirtualMetadata({ target: target.constructor, options: options?.options, name: propertyKey.toString() + (options?.subPath ? `.${options.subPath}` : ''), setter: options?.set, getter: options?.get, }); }; } //# sourceMappingURL=virtual.decorator.js.map