You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					20 lines
				
				493 B
			
		
		
			
		
	
	
					20 lines
				
				493 B
			| 
											3 years ago
										 | 'use strict'; | ||
|  | 
 | ||
|  | const OptionsOperation = require('./options_operation'); | ||
|  | const handleCallback = require('../utils').handleCallback; | ||
|  | 
 | ||
|  | class IsCappedOperation extends OptionsOperation { | ||
|  |   constructor(collection, options) { | ||
|  |     super(collection, options); | ||
|  |   } | ||
|  | 
 | ||
|  |   execute(callback) { | ||
|  |     super.execute((err, document) => { | ||
|  |       if (err) return handleCallback(callback, err); | ||
|  |       handleCallback(callback, null, !!(document && document.capped)); | ||
|  |     }); | ||
|  |   } | ||
|  | } | ||
|  | 
 | ||
|  | module.exports = IsCappedOperation; |