outmoded / catbox-mongodb Goto Github PK
View Code? Open in Web Editor NEWMongoDB adapter for catbox (hapi caching)
License: Other
MongoDB adapter for catbox (hapi caching)
License: Other
On npm the latest version is 3.0.0, however package.json
is set 2.0.0.
Hi, for some reason I'm getting Error: Cannot find module 'catbox-mongodb'
in version 1.1.1, everything works normally in version 1.1.0
I'm using node 4.1.1 and npm 3.3.6
I tried require('node_modules/catbox-mongodb/lib')
and it worked.
here's my output
> require('catbox-mongodb')
Error: Cannot find module 'catbox-mongodb'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at repl:1:1
at REPLServer.defaultEval (repl.js:164:27)
at bound (domain.js:250:14)
at REPLServer.runBound [as eval] (domain.js:263:12)
at REPLServer.<anonymous> (repl.js:393:12)
at emitOne (events.js:82:20)
> require('./node_modules/catbox-mongodb/lib')
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
[Function]
Thank you
Clean up tests per outmoded/discuss#24
It would be nice to not have to re-connect to MongoDB to use this if I'm already connected elsewhere.
Unfortunately I don't have use case for using mongoDB anymore, so I have not been using actively this module for some time.
Therefore I believe that it would be better to pass maintainer position to someone, who uses this module in production and is more aware whats going on in MongoDB world.
Great candidate would be someone who already made some contribution to this module or some other catbox adapter.
All info about maintaining hapi modules is concentrated here: https://github.com/hapijs/contrib
For hapi v18 I had to use some different config
const Hapi = require('hapi')
const CatboxMongoDB = require('catbox-mongodb')
const server = new Hapi.Server({
cache : [{
name : 'mongoDbCache',
provider: {
constructor: CatboxMongoDB,
options: {
uri : 'your-mongodb-uri', // Defaults to 'mongodb://127.0.0.1:27017/?maxPoolSize=5' if not provided
partition : 'cache'
}
}
}]
});
Hi,
Copying the issue from here:
hapijs/yar#73 (comment)
Hello to all,
So problem is next - we have several workers in cluster. 2 of them receive requests almost at the same time - each of them read session storage (MongoDB in our case). In parallel they are finishing their work and save all values of from session
request.session._store
to cache storage. And one of them override value of another, because both of them doesn't see changes of another and dump all data to storage. I'm wondering if exist some technics to avoid such behavior using yar ? Because from my point of view - we should implement in yar some atomic updates, but it should be implemented in catbox adapters too, which requires too much changes in core of Hapi.
Any thoughts?
Regards,
after setting this values
uri: mongodb://username:[email protected]:3000
partition: database-name
with the intention of having as result this string connection
mongodb://username:[email protected]:3000/database-name
after string uri replace, the string connection result is
mongodb://username:dataBAsePassw0rd/database-name
throwing a ´double colon in host identifier´ error at connection time
catbox-mongodb 2.0.0 is updated to newer mongodb 2.0.0
library. Connection parameters are now expressed via connection string, which provides more flexibility.
Thanks to @PavelPolyakov for PR.
Upgrade time: low
Complexity: low
Risk: high, if you are not using default connection settings, you have to update to uri format otherwise it will throw
Connection parameters are now expressed as mongodb uri with exception of database name (partition in catbox terminology), which has to be passed separately as its convention in catbox.
Example:
{
host: '192.168.1.1',
port: 22233,
user: 'admin',
password: '12345',
poolSize: 5,
partition: 'cache'
}
has to be changed to
{
uri: 'mongodb://admin:[email protected]:22233/?maxPoolSize=5',
partition: 'cache'
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.