Comments (4)
In general, we would recommend handling errors using asPromise()
, like const conn = await mongoose.createConnection(uri).asPromise()
rather than relying on on('error')
, but we'll fix this issue.
from mongoose.
Need more details. What's your connection string look like. What else are you doing?
from mongoose.
I want to say that when there's a connection error, The error should be catchable instead of crashing the process, without asking why the connection timed out.
from mongoose.
t looks like the following script throws an uncaught error, we're investigating
'use strict';
const mongoose = require('mongoose');
const conn = mongoose.createConnection('mongodb://fail:27017/mongoose_test', { serverSelectionTimeoutMS: 1000 });
conn.on('error', err => console.log('Error hander', err));
from mongoose.
Related Issues (20)
- query.sort(null) should reset the sort options HOT 8
- Mongoose / mongo omitting part of the document when saved HOT 2
- `InferSchemaType` returns `unknown` value HOT 4
- not getting validation error even i am using validate method in my schema HOT 1
- Mongoose v6 modifies connection options object HOT 4
- Model.insertMany with `lean: true` is very slow compared to native driver
- fix: Cannot run `mongoose.createConnection` under `tsx`/ `esbuild`/ `bun` due to the `nextConnectionId` HOT 4
- Populate with TypeScript not working on Cursor HOT 1
- Missing Typescript detail on Mongoose-specific `options` for updateOne, updateMany, etc. HOT 3
- Facing issue in Mongo+srv which i passing through github actions secrets
- Convenience Method for Converting Array of Strings to ObjectIDs HOT 3
- Round-tripped document fails validation on unmodified Date field HOT 1
- Docs for overwrite option for mongoose.model(), and overwriteModels for mongoose global
- New Mongoose error suddenly due to MongooseError: Buffering timeout HOT 19
- Improve Documentation HOT 1
- BulkSave on entities with virtual properties *and* a transaction: massive performance hit and OOM crashes HOT 5
- Filter query `Condition` type might as well be `any` HOT 3
- pre middleware .save conflict with strict mode HOT 7
- Date coercion and typechecking inconsistent on `bulkWrite` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose.