cacheman-mongo
cacheman-mongo copied to clipboard
mongodb native mode is no more supported after upgrade to 1.0.3
Hi
I have and issue after upgrade from 1.0.1 to 1.0.3.
TypeError: Object #<NativeConnection> has no method 'ensureIndex'
in version 1.0.3 there is new lines which calls ensureIndex. Since this does not exist in native mode above error get thrown
basically I try to run following code
var mongoose = require('mongoose');
var CachemanMongo = require('cacheman-mongo');
console.log('Setting up mongoose');
var mongoose_db;
var cache;
var connect = function() {
var options = {
server: {
socketOptions: {
keepAlive: 1
}
}
};
databaseURL = 'codolutionstest.com:27017/mydb';
mongoose_db = mongoose.createConnection(databaseURL, options);
cache = new CachemanMongo({
client: mongoose_db,
collection: 'cacheman'
});
};
connect();
mongoose_db.on('error', console.log);
mongoose_db.on('disconnected', connect);
cache.get('cacheKey', function(err, data) {
console.log(data);
});
+1
Hi guys, I will check this out tonight!
On Tue, Feb 9, 2016 at 5:32 AM, Youri [email protected] wrote:
+1
— Reply to this email directly or view it on GitHub https://github.com/cayasso/cacheman-mongo/issues/12#issuecomment-181826344 .
J.B.