Optional
blobsize 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
Optional
dateOptional
dateset during the deletion operation, before it is completed (removed from becca completely).
Optional
isOptional
isnumber of note revisions for this note
Optional
utcProtected
beccaStatic
entityStatic
hashedStatic
primaryOptional
type: null | stringOptional
name: null | stringProtected
_getProtected
_setAdds 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 ~/#
value of the attribute - text for labels, target note ID for relations; optional.
Adds a new label to this note. The label attribute is saved and returned.
name of the label, not including the leading #
text value of the label; optional
Adds a new relation to this note. The relation attribute is saved and returned.
name of the relation, not including the leading ~
Some 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.
null if note is not eligible for conversion
(Soft) delete a note and all its descendants.
optional delete identified
Optional
isDeleted: 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)
attribute 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.
Optional
value: null | stringBeware that the method must not create a copy of the array, but actually returns its internal array (for performance reasons)
Optional
type: string(optional) attribute type to filter
Optional
name: 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"
array of noteIds constituting the particular note path
Returns a note path considered to be the "best"
serialized 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
Optional
name: 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
attribute 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)
(optional) attribute type to filter
(optional) attribute name to filter
(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
Optional
name: null | stringrelation name to filter
all note's relations (attributes with type relation), excluding inherited ones
relation name
relation value if relation exists, null otherwise
Optional
name: 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"
Returns strong (as opposed to weak) parent branches. See isWeak for details.
label name
Optional
value: stringlabel value
true if label exists (including inherited)
attribute name
Optional
value: stringattribute value
true if note has an attribute with given type and name (excluding inherited)
label name
Optional
value: stringlabel value
true if label exists (excluding inherited)
relation name
Optional
value: stringrelation value
true if relation exists (excluding inherited)
relation name
Optional
value: stringrelation value
true if relation exists (including inherited)
true if the note has string content (not binary)
true if ancestorNoteId occurs in at least one of the note's paths
boolean - 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.
Protected
putRemoves given attribute name-value pair if it exists.
attribute type (label, relation, etc.)
attribute name
Optional
value: stringattribute value (optional)
Remove label name-value pair, if it exists.
label name
Optional
value: stringlabel value
Remove the relation name-value pair, if it exists.
relation name
Optional
value: stringrelation value (noteId)
Saves entity - executes SQL, but doesn't commit the transaction on its own
Optional
opts: {}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
Optional
value: stringattribute value (optional)
Update's given label's value or creates it if it doesn't exist
label name
Optional
value: stringlabel value
Update's given relation's value or creates it if it doesn't exist
relation name
Optional
value: stringrelation value (noteId)
Based on enabled, the attribute is either set or removed.
attribute type ('relation', 'label' etc.)
toggle On or Off
attribute name
Optional
value: stringattribute value (optional)
Based on enabled, label is either set or removed.
toggle On or Off
label name
Optional
value: stringlabel value (optional)
Based on enabled, relation is either set or removed.
toggle On or Off
relation name
Optional
value: stringrelation value (noteId)
Trilium's main entity, which can represent text note, image, code note, file attachment etc.