Notes
albert.collections.notes.NotesCollection
Bases: BaseCollection
NotesCollection is a collection class for managing Note entities in the Albert platform.
Methods:
| Name | Description |
|---|---|
create |
Creates a new note. |
get_by_id |
Retrieves a note by its ID. |
update |
Updates a note. |
delete |
Deletes a note by its ID. |
get_by_parent_id |
Get all notes by their parent ID. |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
|
Source code in src/albert/collections/notes.py
create
Creates a new note.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
note
|
str
|
The note content. |
required |
Returns:
| Type | Description |
|---|---|
Note
|
The created note. |
Source code in src/albert/collections/notes.py
get_by_id
update
Updates a note.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
note
|
Note
|
The note to update. The note must have an ID. |
required |
Returns:
| Type | Description |
|---|---|
Note
|
The updated note as returned by the server. |
Source code in src/albert/collections/notes.py
delete
delete(*, id: str) -> None
Deletes a note by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The ID of the note to delete. |
required |
get_by_parent_id
Get all notes by their parent ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent_id
|
str
|
The parent ID of the notes to list. |
required |
order_by
|
OrderBy
|
The order to list notes in. Default is DESCENDING. |
DESCENDING
|
Returns:
| Type | Description |
|---|---|
list[Note]
|
A list of Note entities. |