---
url: >-
  https://docs.juniper.bot/en/message-templates/types/storage/guild-index-entry.md
description: GuildIndexEntry data type used in JuniperBot Template Engine.
---

[Number]: /en/message-templates/types/index#literals

[String]: /en/message-templates/types/index#literals

[Boolean]: /en/message-templates/types/index#literals

[List]: /en/message-templates/types/index#lists

[Map]: /en/message-templates/types/index#maps

[DateTime]: /en/message-templates/types/index#datetime

[TwitchChannel]: /en/message-templates/types/subscriptions/twitch#twitch-channel

[TwitchStream]: /en/message-templates/types/subscriptions/twitch#twitch-stream

[TwitchGame]: /en/message-templates/types/subscriptions/twitch#twitch-game

[YouTubeChannel]: /en/message-templates/types/subscriptions/youtube#youtube-channel

[YouTubeVideo]: /en/message-templates/types/subscriptions/youtube#youtube-video

[VkWallPost]: /en/message-templates/types/subscriptions/vk#vkwallpost

[Rank]: /en/message-templates/types/discord/rank

[Guild]: /en/message-templates/types/discord/guild

[Member]: /en/message-templates/types/discord/member

[Role]: /en/message-templates/types/discord/role

[Message]: /en/message-templates/types/discord/message

[Attachment]: /en/message-templates/types/discord/attachment

[Embed]: /en/message-templates/types/discord/embed

[Activity]: /en/message-templates/types/discord/activity

[MemberVoiceState]: /en/message-templates/types/discord/member-voice-state

[MemberPrimaryGuild]: /en/message-templates/types/discord/member-primary-guild

[MenuBuilder]: /en/message-templates/types/discord/menu-builder

[UserFlag]: /en/message-templates/types/discord/user-flag

[Permission]: /en/message-templates/types/discord/permission

[Category]: /en/message-templates/types/discord/category

[TextChannel]: /en/message-templates/types/discord/text-channel

[VoiceChannel]: /en/message-templates/types/discord/voice-channel

[NewsChannel]: /en/message-templates/types/discord/news-channel

[StageChannel]: /en/message-templates/types/discord/stage-channel

[ForumChannel]: /en/message-templates/types/discord/forum-channel

[MediaChannel]: /en/message-templates/types/discord/media-channel

[ThreadChannel]: /en/message-templates/types/discord/thread-channel

[Page]: /en/message-templates/types/storage/page

[GuildIndex]: /en/message-templates/types/storage/guild-index

[GuildIndexEntry]: /en/message-templates/types/storage/guild-index-entry

[GuildIndexes]: /en/message-templates/types/storage/guild-indexes

[MemberAttribute]: /en/message-templates/types/storage/member-attribute

[MemberAttributes]: /en/message-templates/types/storage/member-attributes

[Arguments]: /en/message-templates/types/custom-commands/arguments

[Parameters]: /en/message-templates/types/custom-commands/parameters

[Component]: /en/message-templates/types/custom-commands/component

[Modal]: /en/message-templates/types/custom-commands/modal

# GuildIndexEntry

This data type describes a specific [index](guild-index) entry.

::: info
For more information about guild indexes and how to use them, check
[Guild Indexes](../../persistence/guild-indexes) article.
:::

## Properties { #properties }

| Property    | Type       | Description                          |
|:------------|:-----------|:-------------------------------------|
| `key`       | \[String]   | Entry key                            |
| `value`     | \[Number]   | Entry value                          |
| `metadata`  | \[String]   | Entry metadata                       |
| `indexName` | \[String]   | The index name related to this entry |
| `updatedAt` | \[DateTime] | Update date and time                 |

## Methods { #methods }

### `update(Value, Metadata)` { #method-update .template-method }

::: tabs

\== Description | mdi-text

Updates entry value.

Returns the same value.

**Returns:** \[Number]

\== Parameters | mdi-code-parentheses

| Parameter  | Type     | Description                                                                                                                                                                                                                 |
|:-----------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Value`    | \[Number] | New entry value                                                                                                                                                                                                             |
| `Metadata` | \[String] | New entry metadata. It can be used to store some additional information about entry, up to 500 characters.This parameter is optional and if it's not specified, current metadata will be preserved if it exist. |

\== Examples | mdi-code-block-braces

```template
{% do guild.getIndex('myIndex').get('entryKey').update(123) %}
```

```template
{% do guild.indexes.myIndex.entryKey.update(123) %}
```

:::

### `increment(Number)` { #method-increment .template-method }

::: tabs

\== Description | mdi-text

Increments the value by specified amount and returns new value.

**Returns:** \[Number]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description                                |
|:----------|:---------|:-------------------------------------------|
| `Number`  | \[Number] | Increments the value by a specified number |

\== Examples | mdi-code-block-braces

```template
{% do guild.getIndex('myIndex').get('entryKey').increment(1) %}
```

```template
{% do guild.indexes.myIndex.entryKey.increment(1) %}
```

:::

### `decrement(Number)` { #method-decrement .template-method }

::: tabs

\== Description | mdi-text

Decrements the value by specified amount and returns new value.

**Returns:** \[Number]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description                                |
|:----------|:---------|:-------------------------------------------|
| `Number`  | \[Number] | Decrements the value by a specified number |

\== Examples | mdi-code-block-braces

```template
{% do guild.getIndex('myIndex').get('entryKey').decrement(1) %}
```

```template
{% do guild.indexes.myIndex.entryKey.decrement(1) %}
```

:::

### `clear()` { #method-clear .template-method }

::: tabs

\== Description | mdi-text

Clears entry and deletes it from database.

\== Example | mdi-code-block-braces

```template
{% do guild.getIndex('myIndex').get('entryKey').clear() %}
```

```template
{% do guild.indexes.myIndex.entryKey.clear() %}
```

:::
