mongoose#CreateQuery TypeScript Examples

The following examples show how to use mongoose#CreateQuery. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: base.service.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
insert(entity: T): Promise<DocumentType<T>> {
    (entity as Writable<T>).createdBy = this.getUserId();
    return this.EntityModel.create(entity as CreateQuery<DocumentType<T>>);
  }
Example #2
Source File: user.service.ts    From NextJS-NestJS-GraphQL-Starter with MIT License 5 votes vote down vote up
async create(args: CreateQuery<User>): Promise<User> {
    return this.userModel.create(args);
  }