octonom
Version:
Object Document Mapper for any database
17 lines (12 loc) • 506 B
text/typescript
import { Model, Property, Schema, utils } from '../../../lib/main';
import { collections } from '../collections';
import { PersonModel } from './person';
export class GroupWithReferencesModel extends Model {
.String({default: utils.generateId})
public id: string;
.Array({elementSchema: new Schema.Reference({collection: () => collections.people})})
public members: Array<string | PersonModel>;
constructor(data?: Partial<GroupWithReferencesModel>) {
super(data);
}
}