-
-
Notifications
You must be signed in to change notification settings - Fork 142
/
accounts-mongo-options.ts
50 lines (50 loc) · 1.29 KB
/
accounts-mongo-options.ts
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
export interface AccountsMongoOptions {
/**
* The users collection name.
* Default 'users'.
*/
collectionName?: string;
/**
* The sessions collection name.
* Default 'sessions'.
*/
sessionCollectionName?: string;
/**
* The timestamps for the users and sessions collection.
* Default 'createdAt' and 'updatedAt'.
*/
timestamps?: {
createdAt: string;
updatedAt: string;
};
/**
* Should the user collection use _id as string or ObjectId.
* Default 'true'.
*/
convertUserIdToMongoObjectId?: boolean;
/**
* Should the session collection use _id as string or ObjectId.
* Default 'true'.
*/
convertSessionIdToMongoObjectId?: boolean;
/**
* Perform case intensitive query for user name.
* Default 'true'.
*/
caseSensitiveUserName?: boolean;
/**
* Function that generates the _id for new Session objects.
* If 'undefined' then 'convertSessionIdToMongoObjectId' must be 'true'.
* Default 'undefined'
*/
idSessionProvider?: () => string | object;
/**
* Function that generate the id for new objects.
*/
idProvider?: () => string | object;
/**
* Function that generate the date for the timestamps.
* Default to `(date?: Date) => (date ? date.getTime() : Date.now())`.
*/
dateProvider?: (date?: Date) => any;
}