tagGroup

The eagle.tagGroup API allows easy access to the tag groups in the current application.

// Get all tag groups
const tagGroups = (await eagle.tagGroup.get());

Methods

get()

Retrieves all tag groups.

  • Returns Promise<tagGroups: Object[]> - the query result for tagGroups.

const tagGroups = (await eagle.tagGroup.get());

create(options)

Creates a new tag group.

  • Returns Promise<tagGroup: Object> - the newly created tag group.

await eagle.tagGroup.create({
    name: "new group",
    color: "red",
    tags: ["tag1", "tag2"],
    description: "Group description"  // Eagle 4.0 build18+
});

Instance Methods

save()

Saves changes to the tag group.

  • Returns Promise<tagGroup: Object> - the result of the save operation.

remove()

Removes the tag group.

  • Returns Promise<result: boolean> - whether the removal was successful.

addTags(options)

Incrementally adds tags to the group without needing to pass the complete tags array.

  • options Object - Option parameters

    • tags string[] - Array of tag names to add

    • removeFromSource boolean (optional) - Whether to remove tags from their original groups, defaults to false

      • false: Only add tags (tags can exist in multiple groups)

      • true: Move tags (remove from original groups)

  • Returns Promise<tagGroup: Object> - The updated tag group

circle-info

Note: The addTags() method requires Eagle 4.0 build18 or higher.

removeTags(options)

Removes specified tags from the group.

  • options Object - Option parameters

    • tags string[] - Array of tag names to remove

  • Returns Promise<tagGroup: Object> - The updated tag group

circle-info

Note: The removeTags() method requires Eagle 4.0 build18 or higher.

circle-exclamation

Last updated