mirror of
https://github.com/Priyatham-sai-chand/Locaft-backend.git
synced 2026-10-05 08:51:33 -07:00
20 lines
493 B
JavaScript
20 lines
493 B
JavaScript
|
|
'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;
|