3

I have a model in RavenDb that I am trying to assemble into an index that will make identifying Clips for Channels you follow. Here are the two objects (properties simplified for discussion) I'm attempting to connect:

public class Clip {
  string ChannelId
  DateTimeOffset CreatedAt
  string Title
  ...
}

public class FollowerRecord {
  string FollowerId
  string[] ChannelIDs
}

Each user in the application has only 1 FollowerRecord.

I'd like to output an index that's shaped like this:

public class Index_FollowedClipsByDate {
  string FollowerId
  DateTimeOffset CreatedAt
  string[] Clips 
}

I'm a bit stumped on how to load the FollowerRecord, do the many-to-many join between ChannelIds in the FollowerRecord and Clips, and reduce to 1 record per FollowerId and CreatedAt

Jeff Fritz
  • 9,821
  • 7
  • 42
  • 52

0 Answers0