-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
I'm new to document versioning and have been trialing on a few similar plugins. It may be my mis-configuration, but I have really no idea what's going wrong after attempting for a whole day...
When I comment out the plugin-related script, Mongoose works as expected. But if the plugin is applied, new document cannot be saved and results in timeout...
Debug: handler, error
Error: Operation `issue_patches.insertOne()` buffering timed out after 10000ms
at Toolkit.badRequest (...\microservice-issue\lib\boom.js:43:34)
at handler (...\microservice-issue\lib\controllers\issue.js:95:16)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Below is my models/issue.js
.
'use strict'
const Mongoose = require('mongoose')
// const History = require('mongoose-patch-history').default
const issueSchema = new Mongoose.Schema({
trelloId: String,
trelloUrl: String,
parcelNo: String,
warehouse: String,
courier: String,
issueReason: Number,
photo: [{
url: String,
remark: String
}],
status: {
type: String,
default: 'To Do'
},
updatedBy: String
})
// issueSchema.plugin(History, {
// mongoose: Mongoose,
// name: 'issuePatches'
// })
module.exports = {
name: 'Issue',
schema: issueSchema
}
Versions:
node: 12.18.4
mongodb: 4.2.11
mongoose: 5.11.4
mongoose-patch-history: 2.0.0
Appreciate any help. Thank you!