-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'collection' of null #243
Comments
ah! I think this means that the server cannot connect to a running instance of MongoDb 💡 // server.js
MongoClient.connect(
mongoUrl,
function(err, db) {
var users = db.collection('users') |
let's try a brew upgrade mongodb |
hi former self 👋 did you ever solve this one? 😅 |
|
https://superuser.com/questions/1478156/error-mongodb-unknown-version-mountain-lion ah hah!
|
upgrading our https://www.npmjs.com/package/mongodb |
here's what I see now: ➜ blockbuilder git:(micah/243/mongodb-error) ✗ node server.js
error with https files Error: ENOENT: no such file or directory, open '/Users/m/workspace/blockbuilder/sslcert/privkey.pem'
at Object.openSync (fs.js:457:3)
at Object.readFileSync (fs.js:359:35)
at Object.<anonymous> (/Users/m/workspace/blockbuilder/server.js:25:19)
at Module._compile (internal/modules/cjs/loader.js:1144:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
at Module.load (internal/modules/cjs/loader.js:993:32)
at Function.Module._load (internal/modules/cjs/loader.js:892:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/m/workspace/blockbuilder/sslcert/privkey.pem'
}
express-session deprecated undefined resave option; provide resave option server.js:108:3
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option server.js:108:3
Elasticsearch INFO: 2020-03-02T08:45:02Z
Adding connection to http://35.226.78.72:9200/
(node:5938) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
/Users/m/workspace/blockbuilder/node_modules/mongodb/lib/utils.js:720
throw error;
^
TypeError: Cannot read property 'db' of undefined
at /Users/m/workspace/blockbuilder/server.js:136:21
at /Users/m/workspace/blockbuilder/node_modules/mongodb/lib/utils.js:717:9
at /Users/m/workspace/blockbuilder/node_modules/mongodb/lib/mongo_client.js:222:23
at connectCallback (/Users/m/workspace/blockbuilder/node_modules/mongodb/lib/operations/connect.js:350:5)
at /Users/m/workspace/blockbuilder/node_modules/mongodb/lib/operations/connect.js:417:14
at Server.<anonymous> (/Users/m/workspace/blockbuilder/node_modules/mongodb/lib/topologies/server.js:230:11)
at Object.onceWrapper (events.js:428:26)
at Server.emit (events.js:321:20)
at Pool.<anonymous> (/Users/m/workspace/blockbuilder/node_modules/mongodb/lib/core/topologies/server.js:436:21) |
This issue can be fixed in this way, |
Hey, how to create a new collection.I mean it is creating new collection. |
@muhrizmrz Are you trying to spin up an instance of Blockbuilder? |
steps to reproduce
The text was updated successfully, but these errors were encountered: