You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
I started a normal project and install mongoose.
the version that was installed is 5.4.18
after creating some models ] wanted to test models with mocha .
and ] figure out that mongoose queries are too slow .
each query takes about 1 - 2 second to execute!!
I understood that if I switch to previous versions like 4.4.10 queries will work properly.
this is my simple code for test speed :
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
mongoose.connect("mongodb://localhost:27017/testdb");
let User = mongoose.model('User', new mongoose.Schema({
username: {
type: String,
required: false,
default: '',
min: 0,
max: 255,
},
email: {
type: String,
}
}));
let user = new User({
username: 'test',
email: 'tesafdjklas@gmail.com',
});
let time = (new Date).getTime();
user.save().then(() => {
console.log('OK :' + ((new Date).getTime() - time));
});
after execute with mongoose version 5.4.18 it prints OK :1004 -> about 1 seconds to execute
but by version 4.4.10 it prints OK :40 -> 40 ms
So . why new version is too slow ?
or if I'm doing something wrong, what is it ?
The text was updated successfully, but these errors were encountered:
Hi.
I started a normal project and install mongoose.
the version that was installed is
5.4.18
after creating some models ] wanted to test models with mocha .
and ] figure out that mongoose queries are too slow .
each query takes about 1 - 2 second to execute!!
I understood that if I switch to previous versions like
4.4.10
queries will work properly.this is my simple code for test speed :
after execute with mongoose version
5.4.18
it printsOK :1004
-> about 1 seconds to executebut by version
4.4.10
it printsOK :40
-> 40 msSo . why new version is too slow ?
or if I'm doing something wrong, what is it ?
The text was updated successfully, but these errors were encountered: