Skip to content

Refresh expiration - #2733

Merged
reebhub merged 11 commits into
ravendb:mainfrom
reebhub:refresh_expiration
Nov 23, 2026
Merged

reebhub merged 11 commits into
ravendb:mainfrom
reebhub:refresh_expiration

Conversation

@reebhub

@reebhub reebhub commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Issue link

RDoc-4134 /documents/document-refresh/client-api (Refresh API page) - move, update, add languages
RDoc-4160 /documents/document-refresh/document-refresh-view (Refresh Studio page) - move, update
RDoc-4159 /documents/document-expiration/client-api (Expiration API page) - move, update, add languages
RDoc-4161 /documents/document-expiration/document-expiration-view (Expiration Studio page) - move, update
RDoc-4169 Refresh + Expiration - explain that reverting to a revision removes metadata property
RDoc-4135 add /client-api/session/how-to/get-and-modify-entity-metadata Python page
RDoc-4184 atomic-guards Node.js page: remove duplicate bullet, restore missing bullet

Type of change

  • Content - docs
  • Content - cloud
  • Content - Quill
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

@reebhub
reebhub requested a review from poissoncorp November 8, 2026 15:36
@poissoncorp

Copy link
Copy Markdown
Contributor

Looks good. Please just remove the .fuse_hidden* leftovers and add the Documents Moved label.

@reebhub

reebhub commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@LielNagar (Java pages):

  • docs/documents/document-refresh/content/_client-api-java.mdx
  • docs/documents/document-expiration/content/_client-api-java.mdx
  • docs/client-api/session/how-to/content/_get-and-modify-entity-metadata-java.mdx

@M4xymm (Node.js & PHP pages):

  • docs/documents/document-refresh/content/_client-api-nodejs.mdx
  • docs/documents/document-refresh/content/_client-api-php.mdx
  • docs/documents/document-expiration/content/_client-api-nodejs.mdx
  • docs/documents/document-expiration/content/_client-api-php.mdx
  • docs/client-api/session/how-to/content/_get-and-modify-entity-metadata-nodejs.mdx

@reebhub

reebhub commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@poissoncorp thanks, leftovers removed, label added

Set the `@expires` property to a `java.util.Date` value (e.g., `new Date(System.currentTimeMillis() + 60 * 60 * 1000)`).
The client sends a `Date` value in UTC with a `Z` suffix, which marks the time as UTC, so the server reads the intended time
correctly.
e.g., `"@expires": "2026-12-01T08:00:00.000Z"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contradicts with earlier format (line 63). The correct format in Java should be 7 fractional digits

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (on both the document-refresh and document-expiration Java pages)

Comment on lines +333 to +337
class ExpirationConfiguration
{
boolean disabled
Long deleteFrequencyInSec
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, just add semicolon (syntax)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (changed all class blocks so classes are shown as declared by the client)

Set the `@refresh` property to a `java.util.Date` value (e.g., `new Date(System.currentTimeMillis() + 60 * 60 * 1000)`).
The client sends a `Date` value in UTC with a `Z` suffix, which marks the time as UTC, so the server reads the intended time
correctly.
e.g., `"@refresh": "2026-12-01T08:00:00.000Z"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again same formatting issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


| Return value | |
|--------------|-|
| `IMetadataDictionary` | The entity's metadata.<br />If the session does not track the entity, the method throws an exception. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throws:
IllegalArgumentException - for a null instance/untracked entity.
IllegalStateException - when entity has no id

also for versioned files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (in 6.2-7.2)
added NonUniqueObjectException as well, thrown when the session tracks a different entity with the same document ID.

…and `Document Expiration` client API and Studio pages (7.2) to /documents.
… its Java, Python, PHP, and Node.js versions.
…enshots, added license limit, defaults, processing order, document-view refresh scheduling.
…e (7.2, C#) and add its Java, Python, PHP and Node.js versions.

Document that reverting a revision removes @expires and @refresh (7.2, Document Expiration and Document Refresh pages).
…tadata Python version and update the page's texts and layout (6.2-7.2)
* **Document expires via the expiration feature**:
* Create a document using a cluster-wide session (an associated atomic guard is created).
* Add the `@expires` metadata property the document, as described in [Document expiration](../../studio/database/settings/document-expiration.mdx).
* Add the `@expires` metadata property the document, as described in [Document expiration](../../documents/document-expiration/document-expiration-view.mdx).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is about adding @expires from code, so I think it should point to the client API page rather than the Studio view, e.g. ../../documents/document-expiration/client-api.mdx#scheduling-a-document-s-expiration.

Also small typo carried over: "metadata property the document" -> "metadata property to the document".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* **Document expires via the expiration feature**:
* Create a document using a cluster-wide session (an associated atomic guard is created).
* Add the `@expires` metadata property the document, as described in [Document expiration](../../studio/database/settings/document-expiration.mdx).
* Add the `@expires` metadata property the document, as described in [Document expiration](../../documents/document-expiration/document-expiration-view.mdx).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in the PHP page: link to client-api.mdx#scheduling-a-document-s-expiration instead of the Studio view, and "property the document" -> "property to the document".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* **Document expires via the expiration feature**:
* Create a document using a cluster-wide session (an associated atomic guard is created).
* Add the `@expires` metadata property the document, as described in [Document expiration](../../studio/database/settings/document-expiration.mdx).
* Add the `@expires` metadata property the document, as described in [Document expiration](../../documents/document-expiration/document-expiration-view.mdx).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same link + typo here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

import Admonition from '@theme/Admonition';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeBlock isn't used anywhere in this file, can be removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed unused imports

import Admonition from '@theme/Admonition';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, unused CodeBlock import.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


* In the feature's first run after a document's expiration time, the document is deleted.
* The document may be deleted in a later run if the number of documents due for deletion exceeds the maximum set for
a single run using the Studio option

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: maxItemsToProcess was added to ExpirationConfiguration / RefreshConfiguration in the Node client on v7.2, it'll ship in 7.2.9 (7.2.8 doesn't have it). So pointing to the Studio option is right for now, but once 7.2.9 is out we can document it like in C#. Same applies to the refresh page. Fine to leave for a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opened RDoc-4186, will apply it when the new client is released

@LielNagar
LielNagar self-requested a review November 23, 2026 10:56
@reebhub
reebhub merged commit 3b13641 into ravendb:main Nov 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants