0.1.3 • Published 9 years ago

hibergoose v0.1.3

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

Hibergoose is a wrapper for mogoose to simplify the creation of models using decorators.

Installation

npm install hibergoose --save

Usage

To create a new mongoose model using hibergoose create a class that extends from DbObject. Add the @Collection and @Model decorators to define collection and model names. The @Type decorator on a property is used to set the mongoose Type the property should have in the mongoose schema.

There are many other decorators that help defining your schema using decorators (docs will be up shortly).

@Model('exampleModel')
@Collection('exampleCollection')
public ExampleDb extends DbObject<ExampleDb> {
  @Type(String)
  public name: string;

  @Type(Number)
  @Default(0)
  public group: number;
}
0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

1.0.0

9 years ago