Skip to main content

talawa-api / Exports / libraries/dbLogger / InterfaceLoggableDocument

Interface: InterfaceLoggableDocument

libraries/dbLogger.InterfaceLoggableDocument

Hierarchy

  • Document

    InterfaceLoggableDocument

Table of contents

Properties

Methods

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.

Inherited from

Document.$locals

Defined in

node_modules/mongoose/index.d.ts:554


$op

$op: null | string

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

Inherited from

Document.$op

Defined in

node_modules/mongoose/index.d.ts:563


$where

$where: Record<string, unknown>

Set this property to add additional query filters when Mongoose saves this document and isNew is false.

Inherited from

Document.$where

Defined in

node_modules/mongoose/index.d.ts:578


__v

Optional __v: any

This documents __v.

Inherited from

Document.__v

Defined in

node_modules/mongoose/index.d.ts:522


_id

Optional _id: any

This documents _id.

Inherited from

Document._id

Defined in

node_modules/mongoose/index.d.ts:519


baseModelName

Optional baseModelName: string

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

Inherited from

Document.baseModelName

Defined in

node_modules/mongoose/index.d.ts:581


collection

collection: Collection

Collection the model uses.

Inherited from

Document.collection

Defined in

node_modules/mongoose/index.d.ts:584


db

db: Connection

Connection the model uses.

Inherited from

Document.db

Defined in

node_modules/mongoose/index.d.ts:587


errors

Optional errors: ValidationError

Hash containing current validation errors.

Inherited from

Document.errors

Defined in

node_modules/mongoose/index.d.ts:619


id

Optional id: any

The string version of this documents _id.

Inherited from

Document.id

Defined in

node_modules/mongoose/index.d.ts:635


isNew

isNew: boolean

Boolean flag specifying if the document is new.

Inherited from

Document.isNew

Defined in

node_modules/mongoose/index.d.ts:666


logInfo

logInfo: TransactionLogInfo

Defined in

src/libraries/dbLogger.ts:33


modelName

modelName: string

The name of the model

Inherited from

Document.modelName

Defined in

node_modules/mongoose/index.d.ts:681


schema

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

The document's schema.

Inherited from

Document.schema

Defined in

node_modules/mongoose/index.d.ts:722

Methods

$getAllSubdocs

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

Returns

Document<any, any, any>[]

Inherited from

Document.$getAllSubdocs

Defined in

node_modules/mongoose/index.d.ts:525


$getPopulatedDocs

$getPopulatedDocs(): Document<any, any, any>[]

Returns an array of all populated documents associated with the query

Returns

Document<any, any, any>[]

Inherited from

Document.$getPopulatedDocs

Defined in

node_modules/mongoose/index.d.ts:537


$ignore

$ignore(path): void

Don't run validation on this path or persist changes to this path.

Parameters

NameType
pathstring

Returns

void

Inherited from

Document.$ignore

Defined in

node_modules/mongoose/index.d.ts:528


$isDefault

$isDefault(path): boolean

Checks if a path is set to its default.

Parameters

NameType
pathstring

Returns

boolean

Inherited from

Document.$isDefault

Defined in

node_modules/mongoose/index.d.ts:531


$isDeleted

$isDeleted(val?): boolean

Getter/setter, determines whether the document was removed or not.

Parameters

NameType
val?boolean

Returns

boolean

Inherited from

Document.$isDeleted

Defined in

node_modules/mongoose/index.d.ts:534


$isEmpty

$isEmpty(path): 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

NameType
pathstring

Returns

boolean

Inherited from

Document.$isEmpty

Defined in

node_modules/mongoose/index.d.ts:544


$isValid

$isValid(path): boolean

Checks if a path is invalid

Parameters

NameType
pathstring

Returns

boolean

Inherited from

Document.$isValid

Defined in

node_modules/mongoose/index.d.ts:547


$markValid

$markValid(path): void

Marks a path as valid, removing existing validation errors.

Parameters

NameType
pathstring

Returns

void

Inherited from

Document.$markValid

Defined in

node_modules/mongoose/index.d.ts:557


$parent

$parent(): undefined | Document<any, any, any>

If this document is a subdocument or populated document, returns the document's parent. Returns undefined otherwise.

Returns

undefined | Document<any, any, any>

Inherited from

Document.$parent

Defined in

node_modules/mongoose/index.d.ts:694


$session

$session(session?): 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

NameType
session?null | ClientSession

Returns

ClientSession

Inherited from

Document.$session

Defined in

node_modules/mongoose/index.d.ts:570


$set

$set(path, val, options?): this

Alias for set(), used internally to avoid conflicts

Parameters

NameType
pathstring
valany
options?any

Returns

this

Inherited from

Document.$set

Defined in

node_modules/mongoose/index.d.ts:573

$set(path, val, type, options?): this

Parameters

NameType
pathstring
valany
typeany
options?any

Returns

this

Inherited from

Document.$set

Defined in

node_modules/mongoose/index.d.ts:574

$set(value): this

Parameters

NameType
valueany

Returns

this

Inherited from

Document.$set

Defined in

node_modules/mongoose/index.d.ts:575


delete

delete(options?): any

Removes this document from the db.

Parameters

NameType
options?QueryOptions

Returns

any

Inherited from

Document.delete

Defined in

node_modules/mongoose/index.d.ts:590

delete(options, cb?): void

Parameters

NameType
optionsQueryOptions
cb?Callback<any>

Returns

void

Inherited from

Document.delete

Defined in

node_modules/mongoose/index.d.ts:591

delete(cb): void

Parameters

NameType
cbCallback<any>

Returns

void

Inherited from

Document.delete

Defined in

node_modules/mongoose/index.d.ts:592


deleteOne

deleteOne(options?): any

Removes this document from the db.

Parameters

NameType
options?QueryOptions

Returns

any

Inherited from

Document.deleteOne

Defined in

node_modules/mongoose/index.d.ts:595

deleteOne(options, cb?): void

Parameters

NameType
optionsQueryOptions
cb?Callback<any>

Returns

void

Inherited from

Document.deleteOne

Defined in

node_modules/mongoose/index.d.ts:596

deleteOne(cb): void

Parameters

NameType
cbCallback<any>

Returns

void

Inherited from

Document.deleteOne

Defined in

node_modules/mongoose/index.d.ts:597


depopulate

depopulate(path): this

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

Parameters

NameType
pathstring

Returns

this

Inherited from

Document.depopulate

Defined in

node_modules/mongoose/index.d.ts:600


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[]

Inherited from

Document.directModifiedPaths

Defined in

node_modules/mongoose/index.d.ts:607


equals

equals(doc): 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

NameType
docDocument<any, any, any>

Returns

boolean

Inherited from

Document.equals

Defined in

node_modules/mongoose/index.d.ts:616


execPopulate

execPopulate(): Promise<InterfaceLoggableDocument>

Explicitly executes population and returns a promise. Useful for promises integration.

Returns

Promise<InterfaceLoggableDocument>

Inherited from

Document.execPopulate

Defined in

node_modules/mongoose/index.d.ts:622

execPopulate(callback): void

Parameters

NameType
callbackCallback<InterfaceLoggableDocument>

Returns

void

Inherited from

Document.execPopulate

Defined in

node_modules/mongoose/index.d.ts:623


get

get(path, type?, options?): any

Returns the value of a path.

Parameters

NameType
pathstring
type?any
options?any

Returns

any

Inherited from

Document.get

Defined in

node_modules/mongoose/index.d.ts:626


getChanges

getChanges(): UpdateQuery<InterfaceLoggableDocument>

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

Returns

UpdateQuery<InterfaceLoggableDocument>

Inherited from

Document.getChanges

Defined in

node_modules/mongoose/index.d.ts:632


increment

increment(): this

Signal that we desire an increment of this documents version.

Returns

this

Inherited from

Document.increment

Defined in

node_modules/mongoose/index.d.ts:638


init

init(obj, opts?, cb?): this

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

NameType
objany
opts?any
cb?Callback<InterfaceLoggableDocument>

Returns

this

Inherited from

Document.init

Defined in

node_modules/mongoose/index.d.ts:645


invalidate

invalidate(path, errorMsg, value?, kind?): null | NativeError

Marks a path as invalid, causing validation to fail.

Parameters

NameType
pathstring
errorMsgstring | NativeError
value?any
kind?string

Returns

null | NativeError

Inherited from

Document.invalidate

Defined in

node_modules/mongoose/index.d.ts:648


isDirectModified

isDirectModified(path): boolean

Returns true if path was directly set and modified, else false.

Parameters

NameType
pathstring

Returns

boolean

Inherited from

Document.isDirectModified

Defined in

node_modules/mongoose/index.d.ts:651


isDirectSelected

isDirectSelected(path): boolean

Checks if path was explicitly selected. If no projection, always returns true.

Parameters

NameType
pathstring

Returns

boolean

Inherited from

Document.isDirectSelected

Defined in

node_modules/mongoose/index.d.ts:654


isInit

isInit(path): boolean

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

Parameters

NameType
pathstring

Returns

boolean

Inherited from

Document.isInit

Defined in

node_modules/mongoose/index.d.ts:657


isModified

isModified(path?): 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

NameType
path?string | string[]

Returns

boolean

Inherited from

Document.isModified

Defined in

node_modules/mongoose/index.d.ts:663


isSelected

isSelected(path): boolean

Checks if path was selected in the source query which initialized this document.

Parameters

NameType
pathstring

Returns

boolean

Inherited from

Document.isSelected

Defined in

node_modules/mongoose/index.d.ts:669


markModified

markModified(path, scope?): void

Marks the path as having pending changes to write to the db.

Parameters

NameType
pathstring
scope?any

Returns

void

Inherited from

Document.markModified

Defined in

node_modules/mongoose/index.d.ts:672


model

model<T>(name): T

Returns another Model instance.

Type parameters

NameType
Textends Model<any, {}, {}>

Parameters

NameType
namestring

Returns

T

Inherited from

Document.model

Defined in

node_modules/mongoose/index.d.ts:678


modifiedPaths

modifiedPaths(options?): string[]

Returns the list of paths that have been modified.

Parameters

NameType
options?Object
options.includeChildren?boolean

Returns

string[]

Inherited from

Document.modifiedPaths

Defined in

node_modules/mongoose/index.d.ts:675


overwrite

overwrite(obj): this

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

NameType
objDocumentDefinition<InterfaceLoggableDocument>

Returns

this

Inherited from

Document.overwrite

Defined in

node_modules/mongoose/index.d.ts:688


populate

populate(path, callback?): this

Populates document references, executing the callback when complete. If you want to use promises instead, use this function with execPopulate().

Parameters

NameType
pathstring
callback?Callback<InterfaceLoggableDocument>

Returns

this

Inherited from

Document.populate

Defined in

node_modules/mongoose/index.d.ts:701

populate(path, names, callback?): this

Parameters

NameType
pathstring
namesstring
callback?Callback<InterfaceLoggableDocument>

Returns

this

Inherited from

Document.populate

Defined in

node_modules/mongoose/index.d.ts:702

populate(opts, callback?): this

Parameters

NameType
optsPopulateOptions | PopulateOptions[]
callback?Callback<InterfaceLoggableDocument>

Returns

this

Inherited from

Document.populate

Defined in

node_modules/mongoose/index.d.ts:703


populated

populated(path): any

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

Parameters

NameType
pathstring

Returns

any

Inherited from

Document.populated

Defined in

node_modules/mongoose/index.d.ts:706


remove

remove(options?): Promise<InterfaceLoggableDocument>

Removes this document from the db.

Parameters

NameType
options?QueryOptions

Returns

Promise<InterfaceLoggableDocument>

Inherited from

Document.remove

Defined in

node_modules/mongoose/index.d.ts:709

remove(options?, cb?): void

Parameters

NameType
options?QueryOptions
cb?Callback<any>

Returns

void

Inherited from

Document.remove

Defined in

node_modules/mongoose/index.d.ts:710


replaceOne

replaceOne(replacement?, options?, callback?): Query<any, InterfaceLoggableDocument, {}, InterfaceLoggableDocument>

Sends a replaceOne command with this document _id as the query selector.

Parameters

NameType
replacement?DocumentDefinition<InterfaceLoggableDocument>
options?null | QueryOptions
callback?Callback<any>

Returns

Query<any, InterfaceLoggableDocument, {}, InterfaceLoggableDocument>

Inherited from

Document.replaceOne

Defined in

node_modules/mongoose/index.d.ts:713

replaceOne(replacement?, options?, callback?): Query<any, InterfaceLoggableDocument, {}, InterfaceLoggableDocument>

Parameters

NameType
replacement?Object
options?null | QueryOptions
callback?Callback<any>

Returns

Query<any, InterfaceLoggableDocument, {}, InterfaceLoggableDocument>

Inherited from

Document.replaceOne

Defined in

node_modules/mongoose/index.d.ts:714


save

save(options?): Promise<InterfaceLoggableDocument>

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

NameType
options?SaveOptions

Returns

Promise<InterfaceLoggableDocument>

Inherited from

Document.save

Defined in

node_modules/mongoose/index.d.ts:717

save(options?, fn?): void

Parameters

NameType
options?SaveOptions
fn?Callback<InterfaceLoggableDocument>

Returns

void

Inherited from

Document.save

Defined in

node_modules/mongoose/index.d.ts:718

save(fn?): void

Parameters

NameType
fn?Callback<InterfaceLoggableDocument>

Returns

void

Inherited from

Document.save

Defined in

node_modules/mongoose/index.d.ts:719


set

set(path, val, options?): this

Sets the value of a path, or many paths.

Parameters

NameType
pathstring
valany
options?any

Returns

this

Inherited from

Document.set

Defined in

node_modules/mongoose/index.d.ts:725

set(path, val, type, options?): this

Parameters

NameType
pathstring
valany
typeany
options?any

Returns

this

Inherited from

Document.set

Defined in

node_modules/mongoose/index.d.ts:726

set(value): this

Parameters

NameType
valueany

Returns

this

Inherited from

Document.set

Defined in

node_modules/mongoose/index.d.ts:727


toJSON

toJSON(options?): LeanDocument<InterfaceLoggableDocument>

The return value of this method is used in calls to JSON.stringify(doc).

Parameters

NameType
options?ToObjectOptions

Returns

LeanDocument<InterfaceLoggableDocument>

Inherited from

Document.toJSON

Defined in

node_modules/mongoose/index.d.ts:730

toJSON<T>(options?): T

Type parameters

NameType
Tany

Parameters

NameType
options?ToObjectOptions

Returns

T

Inherited from

Document.toJSON

Defined in

node_modules/mongoose/index.d.ts:731


toObject

toObject(options?): LeanDocument<InterfaceLoggableDocument>

Converts this document into a plain-old JavaScript object (POJO).

Parameters

NameType
options?ToObjectOptions

Returns

LeanDocument<InterfaceLoggableDocument>

Inherited from

Document.toObject

Defined in

node_modules/mongoose/index.d.ts:734

toObject<T>(options?): T

Type parameters

NameType
Tany

Parameters

NameType
options?ToObjectOptions

Returns

T

Inherited from

Document.toObject

Defined in

node_modules/mongoose/index.d.ts:735


unmarkModified

unmarkModified(path): void

Clears the modified state on the specified path.

Parameters

NameType
pathstring

Returns

void

Inherited from

Document.unmarkModified

Defined in

node_modules/mongoose/index.d.ts:738


update

update(update?, options?, callback?): Query<any, InterfaceLoggableDocument, {}, InterfaceLoggableDocument>

Sends an update command with this document _id as the query selector.

Parameters

NameType
update?UpdateWithAggregationPipeline | UpdateQuery<InterfaceLoggableDocument>
options?null | QueryOptions
callback?Callback<any>

Returns

Query<any, InterfaceLoggableDocument, {}, InterfaceLoggableDocument>

Inherited from

Document.update

Defined in

node_modules/mongoose/index.d.ts:741


updateOne

updateOne(update?, options?, callback?): Query<any, InterfaceLoggableDocument, {}, InterfaceLoggableDocument>

Sends an updateOne command with this document _id as the query selector.

Parameters

NameType
update?UpdateWithAggregationPipeline | UpdateQuery<InterfaceLoggableDocument>
options?null | QueryOptions
callback?Callback<any>

Returns

Query<any, InterfaceLoggableDocument, {}, InterfaceLoggableDocument>

Inherited from

Document.updateOne

Defined in

node_modules/mongoose/index.d.ts:744


validate

validate(options): Promise<void>

Executes registered validation rules for this document.

Parameters

NameType
optionsObject
options.pathsToSkip?pathsToSkip

Returns

Promise<void>

Inherited from

Document.validate

Defined in

node_modules/mongoose/index.d.ts:747

validate(pathsToValidate?, options?): Promise<void>

Parameters

NameType
pathsToValidate?pathsToValidate
options?any

Returns

Promise<void>

Inherited from

Document.validate

Defined in

node_modules/mongoose/index.d.ts:748

validate(callback): void

Parameters

NameType
callbackCallbackWithoutResult

Returns

void

Inherited from

Document.validate

Defined in

node_modules/mongoose/index.d.ts:749

validate(pathsToValidate, callback): void

Parameters

NameType
pathsToValidatepathsToValidate
callbackCallbackWithoutResult

Returns

void

Inherited from

Document.validate

Defined in

node_modules/mongoose/index.d.ts:750

validate(pathsToValidate, options, callback): void

Parameters

NameType
pathsToValidatepathsToValidate
optionsany
callbackCallbackWithoutResult

Returns

void

Inherited from

Document.validate

Defined in

node_modules/mongoose/index.d.ts:751


validateSync

validateSync(options): null | ValidationError

Executes registered validation rules (skipping asynchronous validators) for this document.

Parameters

NameType
optionsObject
options.pathsToSkip?pathsToSkip

Returns

null | ValidationError

Inherited from

Document.validateSync

Defined in

node_modules/mongoose/index.d.ts:754

validateSync(pathsToValidate?, options?): null | ValidationError

Parameters

NameType
pathsToValidate?string[]
options?any

Returns

null | ValidationError

Inherited from

Document.validateSync

Defined in

node_modules/mongoose/index.d.ts:755