Options
All
  • Public
  • Public/Protected
  • All
Menu

Manifest describes the Stremio's Addon general informations.

Hierarchy

  • Document
    • IManifest

Index

Properties

$locals

$locals: Record<string, unknown>

Empty object that you can use for storing properties on the document. This is handy for passing data to middleware without conflicting with Mongoose internals.

$op

$op: null | string

A string containing the current operation that Mongoose is executing on this document. May be null, 'save', 'validate', or 'remove'.

$where

$where: Record<string, unknown>

Additional properties to attach to the query when calling save() and isNew is false.

Optional __v

__v: any

This documents __v.

Optional _id

_id: any

This documents _id.

Optional baseModelName

baseModelName: string

If this is a discriminator model, baseModelName is the name of the base model.

catalogs

catalogs: ICatalog[]

collection

collection: Collection

Collection the model uses.

db

db: Connection

Connection the model uses.

description

description: string

Optional errors

errors: ValidationError

Hash containing current validation errors.

id

id: string

idPrefixes

idPrefixes: string[]

isNew

isNew: boolean

Boolean flag specifying if the document is new.

modelName

modelName: string

The name of the model

name

name: string

resources

schema

schema: Schema<Document<any, any>, Model<any, any, any>, undefined>

The document's schema.

types

types: ContentType[]

version

version: string

Methods

$getAllSubdocs

  • $getAllSubdocs(): Document<any, any>[]
  • Returns Document<any, any>[]

$getPopulatedDocs

  • $getPopulatedDocs(): Document<any, any>[]
  • Returns an array of all populated documents associated with the query

    Returns Document<any, any>[]

$ignore

  • $ignore(path: string): void
  • Don't run validation on this path or persist changes to this path.

    Parameters

    • path: string

    Returns void

$isDefault

  • $isDefault(path: string): boolean
  • Checks if a path is set to its default.

    Parameters

    • path: string

    Returns boolean

$isDeleted

  • $isDeleted(val?: boolean): boolean
  • Getter/setter, determines whether the document was removed or not.

    Parameters

    • Optional val: boolean

    Returns boolean

$isEmpty

  • $isEmpty(path: string): boolean
  • Returns true if the given path is nullish or only contains empty objects. Useful for determining whether this subdoc will get stripped out by the minimize option.

    Parameters

    • path: string

    Returns boolean

$isValid

  • $isValid(path: string): boolean
  • Checks if a path is invalid

    Parameters

    • path: string

    Returns boolean

$markValid

  • $markValid(path: string): void
  • Marks a path as valid, removing existing validation errors.

    Parameters

    • path: string

    Returns void

$session

  • $session(session?: null | ClientSession): ClientSession
  • Getter/setter around the session associated with this document. Used to automatically set session if you save() a doc that you got from a query with an associated session.

    Parameters

    • Optional session: null | ClientSession

    Returns ClientSession

$set

  • $set(path: string, val: any, options?: any): IManifest
  • $set(path: string, val: any, type: any, options?: any): IManifest
  • $set(value: any): IManifest
  • Alias for set(), used internally to avoid conflicts

    Parameters

    • path: string
    • val: any
    • Optional options: any

    Returns IManifest

  • Parameters

    • path: string
    • val: any
    • type: any
    • Optional options: any

    Returns IManifest

  • Parameters

    • value: any

    Returns IManifest

delete

  • delete(options?: QueryOptions): any
  • delete(options: QueryOptions, cb?: (err: CallbackError, res: any) => void): void
  • delete(cb: (err: CallbackError, res: any) => void): void
  • Removes this document from the db.

    Parameters

    • Optional options: QueryOptions

    Returns any

  • Parameters

    • options: QueryOptions
    • Optional cb: (err: CallbackError, res: any) => void
        • (err: CallbackError, res: any): void
        • Parameters

          • err: CallbackError
          • res: any

          Returns void

    Returns void

  • Parameters

    • cb: (err: CallbackError, res: any) => void
        • (err: CallbackError, res: any): void
        • Parameters

          • err: CallbackError
          • res: any

          Returns void

    Returns void

deleteOne

  • deleteOne(options?: QueryOptions): any
  • deleteOne(options: QueryOptions, cb?: (err: CallbackError, res: any) => void): void
  • deleteOne(cb: (err: CallbackError, res: any) => void): void
  • Removes this document from the db.

    Parameters

    • Optional options: QueryOptions

    Returns any

  • Parameters

    • options: QueryOptions
    • Optional cb: (err: CallbackError, res: any) => void
        • (err: CallbackError, res: any): void
        • Parameters

          • err: CallbackError
          • res: any

          Returns void

    Returns void

  • Parameters

    • cb: (err: CallbackError, res: any) => void
        • (err: CallbackError, res: any): void
        • Parameters

          • err: CallbackError
          • res: any

          Returns void

    Returns void

depopulate

  • Takes a populated field and returns it to its unpopulated state.

    Parameters

    • path: string

    Returns IManifest

directModifiedPaths

  • directModifiedPaths(): string[]
  • Returns the list of paths that have been directly modified. A direct modified path is a path that you explicitly set, whether via doc.foo = 'bar', Object.assign(doc, { foo: 'bar' }), or doc.set('foo', 'bar').

    Returns string[]

equals

  • equals(doc: Document<any, any>): boolean
  • Returns true if this document is equal to another document.

    Documents are considered equal when they have matching _ids, unless neither document has an _id, in which case this function falls back to using deepEqual().

    Parameters

    • doc: Document<any, any>

    Returns boolean

execPopulate

  • execPopulate(): Promise<IManifest>
  • execPopulate(callback: (err: CallbackError, res: IManifest) => void): void
  • Explicitly executes population and returns a promise. Useful for promises integration.

    Returns Promise<IManifest>

  • Parameters

    • callback: (err: CallbackError, res: IManifest) => void
        • Parameters

          Returns void

    Returns void

get

  • get(path: string, type?: any, options?: any): any
  • Returns the value of a path.

    Parameters

    • path: string
    • Optional type: any
    • Optional options: any

    Returns any

getChanges

  • Returns the changes that happened to the document in the format that will be sent to MongoDB.

    Returns UpdateQuery<IManifest>

increment

  • Signal that we desire an increment of this documents version.

    Returns IManifest

init

  • init(obj: any, opts?: any, cb?: (err: CallbackError, doc: IManifest) => void): IManifest
  • Initializes the document without setters or marking anything modified. Called internally after a document is returned from mongodb. Normally, you do not need to call this function on your own.

    Parameters

    • obj: any
    • Optional opts: any
    • Optional cb: (err: CallbackError, doc: IManifest) => void
        • Parameters

          Returns void

    Returns IManifest

invalidate

  • invalidate(path: string, errorMsg: string | NativeError, value?: any, kind?: string): null | NativeError
  • Marks a path as invalid, causing validation to fail.

    Parameters

    • path: string
    • errorMsg: string | NativeError
    • Optional value: any
    • Optional kind: string

    Returns null | NativeError

isDirectModified

  • isDirectModified(path: string): boolean
  • Returns true if path was directly set and modified, else false.

    Parameters

    • path: string

    Returns boolean

isDirectSelected

  • isDirectSelected(path: string): boolean
  • Checks if path was explicitly selected. If no projection, always returns true.

    Parameters

    • path: string

    Returns boolean

isInit

  • isInit(path: string): boolean
  • Checks if path is in the init state, that is, it was set by Document#init() and not modified since.

    Parameters

    • path: string

    Returns boolean

isModified

  • isModified(path?: string | string[]): boolean
  • Returns true if any of the given paths is modified, else false. If no arguments, returns true if any path in this document is modified.

    Parameters

    • Optional path: string | string[]

    Returns boolean

isSelected

  • isSelected(path: string): boolean
  • Checks if path was selected in the source query which initialized this document.

    Parameters

    • path: string

    Returns boolean

markModified

  • markModified(path: string, scope?: any): void
  • Marks the path as having pending changes to write to the db.

    Parameters

    • path: string
    • Optional scope: any

    Returns void

model

  • model<T>(name: string): T
  • Returns another Model instance.

    Type parameters

    • T: Model<any, {}, {}, T>

    Parameters

    • name: string

    Returns T

modifiedPaths

  • modifiedPaths(options?: { includeChildren?: boolean }): string[]
  • Returns the list of paths that have been modified.

    Parameters

    • Optional options: { includeChildren?: boolean }
      • Optional includeChildren?: boolean

    Returns string[]

overwrite

  • Overwrite all values in this document with the values of obj, except for immutable properties. Behaves similarly to set(), except for it unsets all properties that aren't in obj.

    Parameters

    • obj: _AllowStringsForIds<LeanDocument<IManifest>>

    Returns IManifest

populate

  • populate(path: string, callback?: (err: CallbackError, res: IManifest) => void): IManifest
  • populate(path: string, names: string, callback?: (err: any, res: IManifest) => void): IManifest
  • populate(opts: PopulateOptions | PopulateOptions[], callback?: (err: CallbackError, res: IManifest) => void): IManifest
  • Populates document references, executing the callback when complete. If you want to use promises instead, use this function with execPopulate().

    Parameters

    • path: string
    • Optional callback: (err: CallbackError, res: IManifest) => void
        • Parameters

          Returns void

    Returns IManifest

  • Parameters

    • path: string
    • names: string
    • Optional callback: (err: any, res: IManifest) => void

    Returns IManifest

  • Parameters

    • opts: PopulateOptions | PopulateOptions[]
    • Optional callback: (err: CallbackError, res: IManifest) => void
        • Parameters

          Returns void

    Returns IManifest

populated

  • populated(path: string): any
  • Gets _id(s) used during population of the given path. If the path was not populated, returns undefined.

    Parameters

    • path: string

    Returns any

remove

  • remove(options?: QueryOptions): Promise<IManifest>
  • remove(options?: QueryOptions, cb?: (err: CallbackError, res: any) => void): void
  • Removes this document from the db.

    Parameters

    • Optional options: QueryOptions

    Returns Promise<IManifest>

  • Parameters

    • Optional options: QueryOptions
    • Optional cb: (err: CallbackError, res: any) => void
        • (err: CallbackError, res: any): void
        • Parameters

          • err: CallbackError
          • res: any

          Returns void

    Returns void

replaceOne

  • replaceOne(replacement?: _AllowStringsForIds<LeanDocument<IManifest>>, options?: null | QueryOptions, callback?: (err: any, res: any) => void): Query<any, IManifest, {}>
  • Sends a replaceOne command with this document _id as the query selector.

    Parameters

    • Optional replacement: _AllowStringsForIds<LeanDocument<IManifest>>
    • Optional options: null | QueryOptions
    • Optional callback: (err: any, res: any) => void
        • (err: any, res: any): void
        • Parameters

          • err: any
          • res: any

          Returns void

    Returns Query<any, IManifest, {}>

save

  • save(options?: SaveOptions): Promise<IManifest>
  • save(options?: SaveOptions, fn?: (err: CallbackError, doc: IManifest) => void): void
  • save(fn?: (err: CallbackError, doc: IManifest) => void): void
  • Saves this document by inserting a new document into the database if document.isNew is true, or sends an updateOne operation with just the modified paths if isNew is false.

    Parameters

    • Optional options: SaveOptions

    Returns Promise<IManifest>

  • Parameters

    • Optional options: SaveOptions
    • Optional fn: (err: CallbackError, doc: IManifest) => void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • Optional fn: (err: CallbackError, doc: IManifest) => void
        • Parameters

          Returns void

    Returns void

set

  • set(path: string, val: any, options?: any): IManifest
  • set(path: string, val: any, type: any, options?: any): IManifest
  • set(value: any): IManifest
  • Sets the value of a path, or many paths.

    Parameters

    • path: string
    • val: any
    • Optional options: any

    Returns IManifest

  • Parameters

    • path: string
    • val: any
    • type: any
    • Optional options: any

    Returns IManifest

  • Parameters

    • value: any

    Returns IManifest

toJSON

  • toJSON(options?: ToObjectOptions): LeanDocument<IManifest>
  • toJSON<T>(options?: ToObjectOptions): T
  • The return value of this method is used in calls to JSON.stringify(doc).

    Parameters

    • Optional options: ToObjectOptions

    Returns LeanDocument<IManifest>

  • Type parameters

    • T

    Parameters

    • Optional options: ToObjectOptions

    Returns T

toObject

  • toObject(options?: ToObjectOptions): LeanDocument<IManifest>
  • toObject<T>(options?: ToObjectOptions): T
  • Converts this document into a plain-old JavaScript object (POJO).

    Parameters

    • Optional options: ToObjectOptions

    Returns LeanDocument<IManifest>

  • Type parameters

    • T

    Parameters

    • Optional options: ToObjectOptions

    Returns T

unmarkModified

  • unmarkModified(path: string): void
  • Clears the modified state on the specified path.

    Parameters

    • path: string

    Returns void

update

  • update(update?: UpdateQuery<IManifest> | UpdateWithAggregationPipeline, options?: null | QueryOptions, callback?: (err: CallbackError, res: any) => void): Query<any, IManifest, {}>
  • Sends an update command with this document _id as the query selector.

    Parameters

    • Optional update: UpdateQuery<IManifest> | UpdateWithAggregationPipeline
    • Optional options: null | QueryOptions
    • Optional callback: (err: CallbackError, res: any) => void
        • (err: CallbackError, res: any): void
        • Parameters

          • err: CallbackError
          • res: any

          Returns void

    Returns Query<any, IManifest, {}>

updateOne

  • updateOne(update?: UpdateQuery<IManifest> | UpdateWithAggregationPipeline, options?: null | QueryOptions, callback?: (err: CallbackError, res: any) => void): Query<any, IManifest, {}>
  • Sends an updateOne command with this document _id as the query selector.

    Parameters

    • Optional update: UpdateQuery<IManifest> | UpdateWithAggregationPipeline
    • Optional options: null | QueryOptions
    • Optional callback: (err: CallbackError, res: any) => void
        • (err: CallbackError, res: any): void
        • Parameters

          • err: CallbackError
          • res: any

          Returns void

    Returns Query<any, IManifest, {}>

validate

  • validate(pathsToValidate?: string[], options?: any): Promise<void>
  • validate(callback: (err: CallbackError) => void): void
  • validate(pathsToValidate: string[], callback: (err: CallbackError) => void): void
  • validate(pathsToValidate: string[], options: any, callback: (err: CallbackError) => void): void
  • Executes registered validation rules for this document.

    Parameters

    • Optional pathsToValidate: string[]
    • Optional options: any

    Returns Promise<void>

  • Parameters

    • callback: (err: CallbackError) => void
        • (err: CallbackError): void
        • Parameters

          • err: CallbackError

          Returns void

    Returns void

  • Parameters

    • pathsToValidate: string[]
    • callback: (err: CallbackError) => void
        • (err: CallbackError): void
        • Parameters

          • err: CallbackError

          Returns void

    Returns void

  • Parameters

    • pathsToValidate: string[]
    • options: any
    • callback: (err: CallbackError) => void
        • (err: CallbackError): void
        • Parameters

          • err: CallbackError

          Returns void

    Returns void

validateSync

  • validateSync(pathsToValidate?: string[], options?: any): null | ValidationError
  • Executes registered validation rules (skipping asynchronous validators) for this document.

    Parameters

    • Optional pathsToValidate: string[]
    • Optional options: any

    Returns null | ValidationError

Generated using TypeDoc