Skip to content

mchlbataller/schema-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SchemaConstructor

Enables Joi/yup-like implementation for mongoose schemas.

Quick Start

Install

npm install @mchlbataller/schematypes@1.0.4

Usage

import { Schema } from "mongoose";
import { schemaTypes } from "_utils/database/schemaTypes.ts";

const SomeSchema = new Schema({
	someRequiredStringField: schemaTypes.string().required(),
	someRequiredObjectIdField: schemaTypes.objectId().ref(SomeModel),
});

Created by Michael with <3

About

Mongoose Schema provider

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •