I have this error in my ExpressJS app:
Error updating stream: MongoError: Resulting document after update is larger than 16777216
_http_server.js:192
throw new RangeError(`Invalid status code: ${statusCode}`);
So I assume that my document has exceeded the limit.
How can I increase the limit?
I got this link from this answer. But how do I use it in my app? How do I start?
I am using mongoose to store and retrieve my data.
Any ideas/ hints?
This is my document schema in mongoose:
var mongoose = require("mongoose");
var mongoosePaginate = require('mongoose-paginate');
// Declare schema
var streadatamSchema = new mongoose.Schema({
user_id: {
type: String,
required: true
},
title: {
type: String,
required: true
},
description: {
type: String,
required: true
},
data: {
type: Object
},
entries_number: {
type: Number,
default: 0
},
last_entry_at: {
type: Date
},
created_at: {
type: Date,
default: Date.now,
index: 1 // Note 1
},
});
streamSchema.plugin(mongoosePaginate);
// Export schema
// Model.paginate()
mongoose.model("Stream", streamSchema);
I reckon it is the data
field has too much data in it now.