I use node 0.8.18, express3.2.5, cradle0.6.6. my problem is : after I saved a doc into db, then I delete db to reset my testcase env, but when I save the doc with the same id, cradle told me that doc is exsited! source code as follow:
Repository = new(cradle.Connection)().database(REPOSITORY_NAME_STRING);
...
Repository.save(id, acct, function(err, reply){
if(err) {
errorHandler('POST /guests', JSON.stringify(err));
aEvents.emit('a_aborted', req, res, id);
} else {
db.destroy(function(){
Repository = new(cradle.Connection)().database(REPOSITORY_NAME_STRING);
Repository.create(function(){
/* populate design documents */
populateDesignDocuments();
Repository.get(id,function(err, doc){
if(err && err['error']=='not_found') {
aEvents.emit('a_notFound', id, acct);
} else {
aEvents.emit('a_existed', req, res, id);
}
});
});
});
}
}
then I got the same acct document, it seems still in the cradle cache.
can I clean the cache the same time I delete the db ?