This repository has been archived by the owner on Nov 3, 2018. It is now read-only.
Temporal Relationship Tc:Tc
mj1856 edited this page Jan 26, 2013
·
2 revisions
This is an example of an index with a Tc:Tc relationship. Current employees are indexed by their name and their current manager's current name.
public class Employees_CurrentByManager : AbstractIndexCreationTask<Employee, EmployeeWithManager>
{
public Employees_CurrentByManager()
{
Map = employees =>
from employee in employees
let status = MetadataFor(employee).Value<TemporalStatus>(TemporalMetadata.RavenDocumentTemporalStatus)
where status == TemporalStatus.Current
let manager = LoadDocument<Employee>(employee.ManagerId)
select new
{
employee.Name,
Manager = manager.Name
};
// The manager field is stored so we can return it in a projection.
Store(x => x.Manager, FieldStorage.Yes);
}
}
Introduction
Home
About Temporal Versioning
About DateTimeOffset
Setup
Installation
Enabling The Bundle
Client Initialization
Configuration
Migration
Usage
Specifying Effective Dates
Basic CRUD Operations
Temporal Activation
Querying Temporal Data
Querying Dynamically
Querying a Static Index
Map/Reduce of Current Data
Advanced
Temporal Map/Reduce
Temporal Relationships
Guidance
Getting an Audit Trail
Practical Application Guidance
Reference
Misc