talawa-api / Exports / models/SampleData / InterfaceSampleData
Interface: InterfaceSampleData
models/SampleData.InterfaceSampleData
Hierarchy
-
Document
↳
InterfaceSampleData
Table of contents
Properties
- $locals
- $op
- $where
- __v
- _id
- baseModelName
- collection
- collectionName
- db
- documentId
- errors
- id
- isNew
- schema
Methods
- $assertPopulated
- $clone
- $getAllSubdocs
- $getPopulatedDocs
- $ignore
- $inc
- $isDefault
- $isDeleted
- $isEmpty
- $isValid
- $markValid
- $model
- $parent
- $session
- $set
- deleteOne
- depopulate
- directModifiedPaths
- equals
- get
- getChanges
- increment
- init
- invalidate
- isDirectModified
- isDirectSelected
- isInit
- isModified
- isSelected
- markModified
- model
- modifiedPaths
- overwrite
- populate
- populated
- replaceOne
- save
- set
- toJSON
- toObject
- unmarkModified
- updateOne
- validate
- validateSync
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/types/document.d.ts:71
$op
• $op: null
| "validate"
| "save"
| "remove"
A string containing the current operation that Mongoose is executing
on this document. Can be null
, 'save'
, 'validate'
, or 'remove'
.
Inherited from
Document.$op
Defined in
node_modules/mongoose/types/document.d.ts:84
$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/types/document.d.ts:99
__v
• Optional
__v: any
This documents __v.
Inherited from
Document.__v
Defined in
node_modules/mongoose/types/document.d.ts:26
_id
• Optional
_id: any
This documents _id.
Inherited from
Document._id
Defined in
node_modules/mongoose/types/document.d.ts:23
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/types/document.d.ts:102
collection
• collection: Collection
<Document
>
Collection the model uses.
Inherited from
Document.collection
Defined in
node_modules/mongoose/types/document.d.ts:105
collectionName
• collectionName: "User"
| "Organization"
| "Post"
| "Event"
| "AppUserProfile"
| "Plugin"
Defined in
db
• db: Connection
Connection the model uses.
Inherited from
Document.db
Defined in
node_modules/mongoose/types/document.d.ts:108
documentId
• documentId: string
Defined in
errors
• Optional
errors: ValidationError
Returns the current validation errors.
Inherited from
Document.errors
Defined in
node_modules/mongoose/types/document.d.ts:142
id
• Optional
id: any
The string version of this documents _id.
Inherited from
Document.id
Defined in
node_modules/mongoose/types/document.d.ts:155
isNew
• isNew: boolean
Boolean flag specifying if the document is new.
Inherited from
Document.isNew
Defined in
node_modules/mongoose/types/document.d.ts:191
schema
• schema: Schema
<any
, Model
<any
, any
, any
, any
, any
, any
>, {}, {}, {}, {}, DefaultSchemaOptions
, {}, Document
<unknown
, {}, FlatRecord
<{}>> & FlatRecord
<{}> & Required
<{ _id
: unknown
}>>
The document's schema.
Inherited from
Document.schema
Defined in
node_modules/mongoose/types/document.d.ts:235
Methods
$assertPopulated
▸ $assertPopulated<Paths
>(path
, values?
): Omit
<InterfaceSampleData
, keyof Paths
> & Paths
Assert that a given path or paths is populated. Throws an error if not populated.
Type parameters
Name | Type |
---|---|
Paths | {} |
Parameters
Name | Type |
---|---|
path | string | string [] |
values? | Partial <Paths > |
Returns
Omit
<InterfaceSampleData
, keyof Paths
> & Paths
Inherited from
Document.$assertPopulated
Defined in
node_modules/mongoose/types/document.d.ts:29
$clone
▸ $clone(): this
Returns a deep clone of this document
Returns
this
Inherited from
Document.$clone
Defined in
node_modules/mongoose/types/document.d.ts:32
$getAllSubdocs
▸ $getAllSubdocs(): Document
<any
, any
, any
>[]
Returns
Document
<any
, any
, any
>[]
Inherited from
Document.$getAllSubdocs
Defined in
node_modules/mongoose/types/document.d.ts:35
$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/types/document.d.ts:47
$ignore
▸ $ignore(path
): void
Don't run validation on this path or persist changes to this path.
Parameters
Name | Type |
---|---|
path | string |
Returns
void
Inherited from
Document.$ignore
Defined in
node_modules/mongoose/types/document.d.ts:38
$inc
▸ $inc(path
, val?
): this
Increments the numeric value at path
by the given val
.
When you call save()
on this document, Mongoose will send a
$inc
as opposed to a $set
.
Parameters
Name | Type |
---|---|
path | string | string [] |
val? | number |
Returns
this
Inherited from
Document.$inc
Defined in
node_modules/mongoose/types/document.d.ts:54
$isDefault
▸ $isDefault(path
): boolean
Checks if a path is set to its default.
Parameters
Name | Type |
---|---|
path | string |
Returns
boolean
Inherited from
Document.$isDefault
Defined in
node_modules/mongoose/types/document.d.ts:41
$isDeleted
▸ $isDeleted(val?
): boolean
Getter/setter, determines whether the document was removed or not.
Parameters
Name | Type |
---|---|
val? | boolean |
Returns
boolean
Inherited from
Document.$isDeleted
Defined in
node_modules/mongoose/types/document.d.ts:44
$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
Name | Type |
---|---|
path | string |
Returns
boolean
Inherited from
Document.$isEmpty
Defined in
node_modules/mongoose/types/document.d.ts:61
$isValid
▸ $isValid(path
): boolean
Checks if a path is invalid
Parameters
Name | Type |
---|---|
path | string |
Returns
boolean
Inherited from
Document.$isValid
Defined in
node_modules/mongoose/types/document.d.ts:64
$markValid
▸ $markValid(path
): void
Marks a path as valid, removing existing validation errors.
Parameters
Name | Type |
---|---|
path | string |
Returns
void
Inherited from
Document.$markValid
Defined in
node_modules/mongoose/types/document.d.ts:74
$model
▸ $model<ModelType
>(name
): ModelType
Returns the model with the given name on this document's associated connection.
Type parameters
Name | Type |
---|---|
ModelType | Model <unknown , {}, {}, {}, Document <unknown , {}, unknown > & { _id : ObjectId }, any > |
Parameters
Name | Type |
---|---|
name | string |
Returns
ModelType
Inherited from
Document.$model
Defined in
node_modules/mongoose/types/document.d.ts:77
▸ $model<ModelType
>(): ModelType
Type parameters
Name | Type |
---|---|
ModelType | Model <any , {}, {}, {}, any , any > |
Returns
ModelType
Inherited from
Document.$model
Defined in
node_modules/mongoose/types/document.d.ts:78
$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/types/document.d.ts:219
$session
▸ $session(session?
): null
| 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
Name | Type |
---|---|
session? | null | ClientSession |
Returns
null
| ClientSession
Inherited from
Document.$session
Defined in
node_modules/mongoose/types/document.d.ts:91
$set
▸ $set(path
, val
, type
, options?
): this
Alias for set()
, used internally to avoid conflicts
Parameters
Name | Type |
---|---|
path | string | Record <string , any > |
val | any |
type | any |
options? | DocumentSetOptions |
Returns
this
Inherited from
Document.$set
Defined in
node_modules/mongoose/types/document.d.ts:94
▸ $set(path
, val
, options?
): this
Parameters
Name | Type |
---|---|
path | string | Record <string , any > |
val | any |
options? | DocumentSetOptions |
Returns
this
Inherited from
Document.$set
Defined in
node_modules/mongoose/types/document.d.ts:95
▸ $set(value
): this
Parameters
Name | Type |
---|---|
value | string | Record <string , any > |
Returns
this
Inherited from
Document.$set
Defined in
node_modules/mongoose/types/document.d.ts:96
deleteOne
▸ deleteOne(options?
): any
Removes this document from the db.
Parameters
Name | Type |
---|---|
options? | QueryOptions <unknown > |
Returns
any
Inherited from
Document.deleteOne
Defined in
node_modules/mongoose/types/document.d.ts:111
depopulate
▸ depopulate(path?
): this
Takes a populated field and returns it to its unpopulated state. If called with no arguments, then all populated fields are returned to their unpopulated state.
Parameters
Name | Type |
---|---|
path? | string | string [] |
Returns
this
Inherited from
Document.depopulate
Defined in
node_modules/mongoose/types/document.d.ts:123
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/types/document.d.ts:130
equals
▸ equals(doc
): boolean
Returns true if this document is equal to another document.
Documents are considered equal when they have matching _id
s, unless neither
document has an _id
, in which case this function falls back to using
deepEqual()
.
Parameters
Name | Type |
---|---|
doc | Document <any , any , any > |
Returns
boolean
Inherited from
Document.equals
Defined in
node_modules/mongoose/types/document.d.ts:139
get
▸ get<T
>(path
, type?
, options?
): any
Returns the value of a path.
Type parameters
Name | Type |
---|---|
T | extends string | number | symbol |
Parameters
Name | Type |
---|---|
path | T |
type? | any |
options? | any |
Returns
any
Inherited from
Document.get
Defined in
node_modules/mongoose/types/document.d.ts:145
▸ get(path
, type?
, options?
): any
Parameters
Name | Type |
---|---|
path | string |
type? | any |
options? | any |
Returns
any
Inherited from
Document.get
Defined in
node_modules/mongoose/types/document.d.ts:146
getChanges
▸ getChanges(): UpdateQuery
<InterfaceSampleData
>
Returns the changes that happened to the document in the format that will be sent to MongoDB.
Returns
UpdateQuery
<InterfaceSampleData
>
Inherited from
Document.getChanges
Defined in
node_modules/mongoose/types/document.d.ts:152
increment
▸ increment(): this
Signal that we desire an increment of this documents version.
Returns
this
Inherited from
Document.increment
Defined in
node_modules/mongoose/types/document.d.ts:158
init
▸ init(obj
, opts?
): 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
Name | Type |
---|---|
obj | AnyObject |
opts? | AnyObject |
Returns
this
Inherited from
Document.init
Defined in
node_modules/mongoose/types/document.d.ts:165
invalidate
▸ invalidate<T
>(path
, errorMsg
, value?
, kind?
): null
| NativeError
Marks a path as invalid, causing validation to fail.
Type parameters
Name | Type |
---|---|
T | extends string | number | symbol |
Parameters
Name | Type |
---|---|
path | T |
errorMsg | string | NativeError |
value? | any |
kind? | string |
Returns
null
| NativeError
Inherited from
Document.invalidate
Defined in
node_modules/mongoose/types/document.d.ts:168
▸ invalidate(path
, errorMsg
, value?
, kind?
): null
| NativeError
Parameters
Name | Type |
---|---|
path | string |
errorMsg | string | NativeError |
value? | any |
kind? | string |
Returns
null
| NativeError
Inherited from
Document.invalidate
Defined in
node_modules/mongoose/types/document.d.ts:169