When a document is downloaded from the server, it contains various metadata information like ID or current change-vector. This information is stored in a session and is available for each entity using the getMetadataFor method from the advanced session operations.
Get the Metadata
Entity for which metadata will be returned.
Returns the metadata for the specified entity. Throws an exception if the instance is not tracked by the session.