|
|
@ -210,16 +210,11 @@ Collection.prototype.reIndex = function (cb) { |
|
|
|
} |
|
|
|
|
|
|
|
Collection.prototype.isCapped = function (cb) { |
|
|
|
var cursor = new Cursor({ |
|
|
|
query: {name: this._fullColName()}, |
|
|
|
projection: {}, |
|
|
|
onserver: this._getConnection, |
|
|
|
fullCollectionName: this._dbname + '.system.namespaces' |
|
|
|
}) |
|
|
|
var self = this |
|
|
|
this._getConnection(function (err, connection) { |
|
|
|
if (err) { return cb(err) } |
|
|
|
|
|
|
|
cursor.toArray(function (err, cols) { |
|
|
|
if (err) return cb(err) |
|
|
|
cb(null, (cols[0].options && cols[0].options.capped) || false) |
|
|
|
connection.collection(self._fullColName()).isCapped(cb) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|