Add index
This commit is contained in:
		
							parent
							
								
									3cf6eab119
								
							
						
					
					
						commit
						85d98f1e37
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -2,6 +2,7 @@ import * as mongo from 'mongodb';
 | 
				
			||||||
import db from '../db/mongodb';
 | 
					import db from '../db/mongodb';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const PostWatching = db.get<IPostWatching>('postWatching');
 | 
					const PostWatching = db.get<IPostWatching>('postWatching');
 | 
				
			||||||
 | 
					PostWatching.createIndex(['userId', 'postId'], { unique: true });
 | 
				
			||||||
export default PostWatching;
 | 
					export default PostWatching;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IPostWatching {
 | 
					export interface IPostWatching {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue