blob: 58d55bbeef9e8bb47a4e0a0ba68f82a9dd94adaa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import * as mongo from 'mongodb';
import db from '../db/mongodb';
const Following = db.get<IFollowing>('following');
Following.createIndex('followerId');
Following.createIndex('followeeId');
Following.createIndex(['followerId', 'followeeId'], { unique: true });
export default Following;
export type IFollowing = {
_id: mongo.ObjectID;
createdAt: Date;
followeeId: mongo.ObjectID;
followerId: mongo.ObjectID;
stalk: boolean;
// 非正規化
_followee: {
host: string;
inbox?: string;
sharedInbox?: string;
},
_follower: {
host: string;
inbox?: string;
sharedInbox?: string;
}
};
|