Skip to content

Instantly share code, notes, and snippets.

@mfrobben
Created November 6, 2012 21:21
Show Gist options
  • Save mfrobben/4027649 to your computer and use it in GitHub Desktop.
Save mfrobben/4027649 to your computer and use it in GitHub Desktop.
Mongo db input / output when running convertToCapped
// create a db instance via driver
var db = new Db(self.database, serverConnection, dbOptions);
db.open(function(err, _db){
// works fine
}
db.command({"convertToCapped": collectionName, size: collOptions.size},
function(err, result){
console.log('err', err)
console.log('result', result)
}
)
// Returns the following output:
// err null
// result { errmsg: 'cloneCollectionAsCapped failed: { errmsg: "exception: source collection 507-test.queue does not exist", code: 10301, ok: 0.0 }', ok: 0 }
// Expected Result:
// err {errmsg: ...}
// result null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment