Typegoose - Define Mongoose models using TypeScript classes.
MIT License
Bot releases are hidden (Show)
Includes since last pre-release:
SchemaTypeOptions
, the options are now defaulted to the outer-layerinnerOptions
and outerOptions
can now be used for Maps toomessage
being an functionmapOptions
now always errors if the given type dosnt extend mongoose.SchemaTypeOptions
Includes since last pre-release:
mongoose
to 5.9.19@types/mongoose
to 5.7.27@types/lodash
to 4.14.155typescript
to 3.9.5TimeStamps
's (Default Class) properties are not marked as Readonly
anymoreundefined
as the first parameter too (if an type was OR with undefined
, the function would give an type-error)discriminators
for embedded Discriminators [#248]ClassDecorator
& PropertyDecorator
)warnMixed
_buildPropMetadata
to its own file (processProp
) and renamed it to processProp
[#286]prop
into processProp
[#286]NoMetadataError
Type
needs to be defined in prop
/ processProp
Published by hasezoey over 4 years ago
mongoose
to 5.9.17@types/mongoose
to 5.7.21typescript
to 3.9.3RefSchemaType
mongoose.Schema.Types.*
that are suitable for ref to RefType
@mapProp
(TDEP0002
) & @arrayProp
(TDEP0001
)type
-alias options, items
& of
& refType
(TDEP0003
)mongoose.Types.Array<Ref<>>
for Typeguards (isDocumentArray
& isRefTypeArray
) [#278]Published by hasezoey over 4 years ago
ref
is set but is undefined/null
mongoose.Types.DocumentArray
and mongoose.Schema.Types.DocumentArray
to @prop
array-detectionif (!kind)
to if (isNullOrUndefined(kind))
Published by hasezoey over 4 years ago
@prop
options types now work againBasePropOptions.type
is now unkown
instead of any
BasePropOptions.type
now inherit the types from thererefType
is now moved to prop
Published by hasezoey over 4 years ago
PropOptions
PropOptionsWithValidate
PropOptionsWithNumberValidate
to PropOptionsForNumber
PropOptionsWithStringValidate
to PropOptionsForString
options
& match
for VirtualOptions
enum
for ValidateNumberOptions
arrayProp
& mapProp
are now just an alias for prop
@deprecated
for arrayProp
and mapProp
mongoose.Types.Array
& mongoose.Schema.Types.Array
as Array
in @prop
mongoose.Types.Map
& mongoose.Schema.Types.Map
as Map
in @prop
@prop
Base
's __v
& __t
are now optional (with ?
)mongoose.Schema.Types.String
& mongoose.Schema.Types.Number
as valid enum typesof
& items
are now mapped to type
and get called when buildSchema
is calledprop.ts
Published by hasezoey over 4 years ago
mongoose
to 5.9.14@types/mongoose
to 5.7.19tslib
to 2.0.0typescript
to 3.9.2queryMethod
reflectionqueryMethod
ref
with an arrow-function (ref: () => type
)
@queryMethod
decorator@queryMethod
decorator now has correct types [#247]addModelToTypegoose
, getModelForClass
, buildSchema
, deleteModelWithClass
, getDiscriminatorModelForClass
now have the T
generic removed (it was unnecessary)addModelToTypegoose
, getModelForClass
, getDiscriminatorModelForClass
now have an new optional generic QueryHelpers
ReturnModelType
now has the T
generic removed (it was unnecessary)ReturnModelType
now has an second optional generic QueryHelpers
ref: Class
didnt execute getName
when Virtual-Populate was used@prop
for arrays & maps (In preparation for 8.0), it is now auto-detected based on design:type
@plugin
now automatically infers the options if the plugin & function have typings and use optionsIncludes since last pre-release:
ref
with an arrow-function (ref: () => type
)
@queryMethod
decorator@queryMethod
decorator now has correct types [#247]addModelToTypegoose
, getModelForClass
, buildSchema
, deleteModelWithClass
, getDiscriminatorModelForClass
now have the T
generic removed (it was unnecessary)addModelToTypegoose
, getModelForClass
, getDiscriminatorModelForClass
now have an new optional generic QueryHelpers
ReturnModelType
now has the T
generic removed (it was unnecessary)ReturnModelType
now has an second optional generic QueryHelpers
Includes since last pre-release:
mongoose
to 5.9.13@types/mongoose
to 5.7.16tslib
to 1.11.2queryMethod
reflectionqueryMethod
Published by hasezoey over 4 years ago
mongoose
to 5.9.10@types/mongoose
to 5.7.12arrayProp
options got remove
itemsRef
replaced with plain ref
itemsRefPath
replaced with plain refPath
itemsRefType
replaced with plain refType
src/types
to src/internal/constants
src/types
now get exported as type
errors
types
utils
's getName
function now gets exportedaddNullToEnum
overwrite
for VirtualOptions
& T
from ModelType
)queryMethod
optionsProp
to modelOptions
TG_USE_NEW_ENUM
from documentation & codeassertion
functionmodel
anymore)Includes since last pre-release:
mongoose
to 5.9.10@types/mongoose
to 5.7.12semver
to 7.3.2queryMethod
language_override
to IndexOptions
addNullToEnum
optionsProp
to modelOptions
Published by hasezoey over 4 years ago
semver
to 7.3.2tslib
to 1.11.1loglevel
to 1.6.8useNewEnum
type from types
Mixed
(fixes #152)language_override
to IndexOptions
Includes since last pre-release:
& T
from ModelType
)TG_USE_NEW_ENUM
from documentation & codeassertion
functionIncludes since last pre-release:
arrayProp
options got remove
itemsRef
replaced with plain ref
itemsRefPath
replaced with plain refPath
itemsRefType
replaced with plain refType
src/types
to src/internal/constants
src/types
now get exported as type
errors
types
utils
's getName
function now gets exportedoverwrite
for VirtualOptions
model
anymore)mongoose
to 5.9.9@types/mongoose
to 5.7.10tslib
to 1.11.1loglevel
to 1.6.8semver
to 7.3.0Published by hasezoey over 4 years ago
mongoose
to 5.9.2@types/mongoose
to 5.7.1semver
to 7.1.3loglevel
to 1.6.7tslib
to 1.11.0__uniqueID
, because it was not used internally anymorePublished by hasezoey over 4 years ago
Published by hasezoey over 4 years ago
Published by hasezoey over 4 years ago
mongoose
to 5.8.11@types/mongoose
to 5.7.0semver
to 7.1.2@types/mongoose
to peerDependencies
@plugin
to set the type for the optionsRef
-Type to automaticly get the type (if the Ref'd type has string
as _id
, it automaticly sets the RefType
to string
)Published by hasezoey over 4 years ago