Optionalblobsize of the note content, attachment contents and revision contents in bytes
size of the note content, attachment contents in bytes
size of the content in bytes
OptionaldateOptionaldateset during the deletion operation, before it is completed (removed from becca completely).
OptionalisOptionalisnumber of note revisions for this note
OptionalutcProtectedbeccaOptionaltype: stringOptionalname: stringProtected_Protected_Optionalopts: ContentOptsAdds a new attribute to this note. The attribute is saved and returned. See addLabel, addRelation for more specific methods.
attribute type (label / relation)
name of the attribute, not including the leading ~/#
Optionalvalue: stringvalue of the attribute - text for labels, target note ID for relations; optional.
OptionalisInheritable: booleanOptionalposition: numberAdds a new label to this note. The label attribute is saved and returned.
name of the label, not including the leading #
Optionalvalue: stringtext value of the label; optional
OptionalisInheritable: booleanAdds a new relation to this note. The relation attribute is saved and returned.
name of the relation, not including the leading ~
OptionalisInheritable: booleanSome notes are eligible for conversion into an attachment of its parent, note must have these properties:
Currently, works only for image notes.
In the future, this functionality might get more generic and some of the requirements relaxed.
Optionalopts: ConvertOptsnull if note is not eligible for conversion
(Soft) delete a note and all its descendants.
OptionaldeleteId: stringoptional delete identified
OptionaltaskContext: TaskContext<"deleteNotes">OptionalisDeleted: booleanGives all possible note paths leading to this note. Paths containing search note are ignored (could form cycles)
array of notePaths (each represented by array of noteIds constituting the particular note path)
Optionalopts: AttachmentOptsOptionalopts: AttachmentOptsattribute type (label, relation, etc.)
attribute name
attribute of the given type and name. If there are more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
Return an attribute by it's attributeId. Requires the attribute cache to be available.
the id of the attribute owned by this note
Optionalvalue: stringBeware that the method must not create a copy of the array, but actually returns its internal array (for performance reasons)
Optionaltype: string(optional) attribute type to filter
Optionalname: string(optional) attribute name to filter
all note's attributes, including inherited ones
attribute type (label, relation, etc.)
attribute name
attribute value of given type and name or null if no such attribute exists.
Returns a note path considered to be the "best"
OptionalhoistedNoteId: stringarray of noteIds constituting the particular note path
Returns a note path considered to be the "best"
OptionalhoistedNoteId: stringserialized note path (e.g. 'root/a1h315/js725h')
Note content has quite special handling - it's not a separate entity, but a lazily loaded part of Note entity with its own sync. Reasons behind this hybrid design has been:
This is used for:
returns only notes which are templated, does not include their subtrees in effect returns notes which are influenced by note's non-inheritable attributes
valid object or null if the content cannot be parsed as JSON
Optionalname: stringlabel name to filter
all note's labels (attributes with type label), including inherited ones
label name
label value if label exists, null otherwise
label name to filter
all note's label values, including inherited ones
Optionalvalue: stringattribute belonging to this specific note (excludes inherited attributes)
This method can be significantly faster than the getAttribute()
Beware that the method must not create a copy of the array, but actually returns its internal array (for performance reasons)
Optionaltype: string(optional) attribute type to filter
Optionalname: string(optional) attribute name to filter
Optionalvalue: string(optional) attribute value to filter
note's "owned" attributes - excluding inherited ones
attribute type (label, relation, etc.)
attribute name
attribute value of given type and name or null if no such attribute exists.
label name to filter
all note's labels (attributes with type label), excluding inherited ones
label name
label value if label exists, null otherwise
label name to filter
all note's label values, excluding inherited ones
Optionalname: stringrelation name to filter
all note's relations (attributes with type relation), excluding inherited ones
relation name
relation value if relation exists, null otherwise
Optionalname: stringrelation name to filter
all note's relations (attributes with type relation), including inherited ones
relation name
relation value if relation exists, null otherwise
JS script environment - either "frontend" or "backend"
OptionalhoistedNoteId: stringReturns strong (as opposed to weak) parent branches. See isWeak for details.
Optional__namedParameters: { includeArchived?: boolean; includeHidden?: boolean; resolveSearch?: boolean }Optional__namedParameters: { includeArchived?: boolean; includeHidden?: boolean; resolveSearch?: boolean }includes the subtree root note as well
Optionalvalue: stringlabel name
Optionalvalue: stringlabel value
true if label exists (including inherited)
attribute name
Optionalvalue: stringattribute value
true if note has an attribute with given type and name (excluding inherited)
label name
Optionalvalue: stringlabel value
true if label exists (excluding inherited)
relation name
Optionalvalue: stringrelation value
true if relation exists (excluding inherited)
relation name
Optionalvalue: stringrelation value
true if relation exists (including inherited)
true if the note has string content (not binary)
Optionalpath: string[]true if ancestorNoteId occurs in at least one of the note's paths
Optionalopts: ConvertOptsboolean - true if there's no non-hidden path, note is not cloned to the visible tree
true if this note is HTML
true if this note is an image
true if this note is JavaScript (code or attachment)
true if this note is of application/json content type
label name
true if label exists (including inherited) and does not have "false" value.
true if this note is the root of the note tree. Root note has "root" noteId
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use note.deleteNote() and 'branch.deleteBranch()` instead.
OptionaldeleteId: stringProtectedputRemoves given attribute name-value pair if it exists.
attribute type (label, relation, etc.)
attribute name
Optionalvalue: stringattribute value (optional)
Remove label name-value pair, if it exists.
label name
Optionalvalue: stringlabel value
Remove the relation name-value pair, if it exists.
relation name
Optionalvalue: stringrelation value (noteId)
Saves entity - executes SQL, but doesn't commit the transaction on its own
Optionalopts: {}OptionalmatchBy: "attachmentId" | "title"choose by which property we detect if to update an existing attachment. Supported values are either 'attachmentId' (default) or 'title'
Update's given attribute's value or creates it if it doesn't exist
attribute type (label, relation, etc.)
attribute name
Optionalvalue: stringattribute value (optional)
Sets an attribute's value by it's attributeId.
the id of the attribute owned by this note
Optionalvalue: stringthe new value to replace
Optionalopts: ContentOptsUpdate's given label's value or creates it if it doesn't exist
label name
Optionalvalue: stringlabel value
Update's given relation's value or creates it if it doesn't exist
relation name
Optionalvalue: stringrelation value (noteId)
Based on enabled, the attribute is either set or removed.
attribute type ('relation', 'label' etc.)
toggle On or Off
attribute name
Optionalvalue: stringattribute value (optional)
Based on enabled, label is either set or removed.
toggle On or Off
label name
Optionalvalue: stringlabel value (optional)
Based on enabled, relation is either set or removed.
toggle On or Off
relation name
Optionalvalue: stringrelation value (noteId)
Trilium's main entity, which can represent text note, image, code note, file attachment etc.