Automattic/mongoose
Documented errors, page 2 of 3. Back to Automattic/mongoose
| Code / Message | Type | Severity | Tags |
|---|---|---|---|
| You can only add an embedded discriminator on a document… | exception | error | discriminators, arrays, embedded-documents, schema-definition |
| Must provide a filter object. | exception | error | mongoose, bulkwrite, updateone, filter, validation |
| Path " " is not an array | exception | error | virtuals, apply-to-array, arrays, schema-definition |
| Can't use with String. | exception | error | mongoose, query, operators, string, castforquery |
| Expected path " " to be populated | exception | error | mongoose, populate, assertion, unpopulated-path, subdocument |
| Converting unsupported SchemaType to JSON Schema | exception | error | mongoose, json-schema, mixed, schema-introspection |
| For your own good, Mongoose does not know how to remove an… | exception | error | mongoose, subdocument, deleteone, array, missing-id |
| Query.prototype.findOne() no longer accepts a callback | exception | error | mongoose, callback, promise, migration, breaking-change, findone |
| AggregationCursor.prototype.eachAsync() no longer accepts a… | exception | error | aggregation-cursor, eachasync, callback, promise, mongoose-7, migration |
| Parameter "doc" to insertOne() must be an object, got | exception | error | mongoose, insertone, type-validation, invalid-argument, json-parse |
| Invalid value for alias option on | exception | error | mongoose, schema, alias, invalid-argument |
| Query.prototype.exec() no longer accepts a callback | exception | error | mongoose, callback-removed, migration, promise |
| Can't use with UUID. | exception | error | mongoose, uuid, query, operators |
| Connection.prototype.dropCollection() no longer accepts a… | exception | error | dropcollection, callbacks, migration, mongoose-7 |
| No populated model found for path | exception | error | mongoose, populate, array, internal-bug |
| " " cannot be casted to a UUID | exception | error | mongoose, uuid, cast, type-mismatch |
| Cast to Int32 failed for value | exception | error | mongoose, int32, cast, integer-overflow, validation |
| Connection.prototype.close() no longer accepts a callback | exception | error | close, connection-lifecycle, callbacks, migration, mongoose-7 |
| invalid argument | exception | error | mongoose, geospatial, near, invalid-argument, typeerror |
| First argument to `Model` constructor must be an object… | exception | error | mongoose, model, constructor, api-misuse |
| Collection#ensureIndex unimplemented by driver | exception | error | mongoose, driver, index, legacy-api |
| Connection.prototype.startSession() no longer accepts a… | exception | error | session, callbacks, migration, mongoose-7 |
| Path ` ` is not in the schema | exception | error | mongoose, schema, pick, unknown-path |
| Query.prototype.deleteMany() no longer accepts a callback | exception | error | mongoose, callback, promise, migration, breaking-change, delete |
| Path " " may not have `index` set to false and `unique` set… | exception | error | mongoose, schema, index, unique, options |
| Model.prototype.save() no longer accepts a callback | exception | error | mongoose, save, callback, promises, migration |
| Aggregate `near()` argument must have a `near` property | exception | warning | mongoose, deprecation, validation, document, mongoose-10 |
| Model.findOneAndUpdate() no longer accepts a callback | exception | error | mongoose, callback-removed, promise, query, update, migration |
| No connections to database | exception | warning | mongoose, multi-tenant, usedb, removedb, connection |
| Cast to failed for value " " (type ) at path | validation | error | mongoose, populate, cast-error, reference |
| Connection.prototype.openUri() no longer accepts a callback | exception | error | connect, openuri, callbacks, migration, mongoose-7 |
| Invalid sort value: : } | exception | error | mongoose, query, sort, typeerror, invalid-value, request-params |
MONGOOSE Mongoose: looks like you're trying to test a Mongoose app with Jest's default… | console | error | |
| Cannot set a document's session to a session that has… | exception | error | mongoose, sessions, transactions, mongodb-driver |
| Query was already executed | exception | error | mongoose, query-reuse, exec, migration |
| Schema for array path | exception | error | |
| Cast to Number failed: value is not a valid number | exception | error | mongoose, number, cast, nan |
| Model.findOneAndDelete() no longer accepts a callback | exception | error | mongoose, callback, promise, migration, api-change, delete |
| Query filter must be an object, got an array | exception | error | mongoose, query, cast, filter, validation |
| First parameter to `deleteModel()` must be a string or… | validation | error | model, deletemodel, invalid-argument-type, api-misuse |
| Cannot call `setClient()` on a connection that is already… | exception | error | mongoose, setclient, connection-state, lifecycle |
| Path " " is not in schema and strictQuery is 'throw'. | exception | error | mongoose, strict-query, schema, query |
| Reference virtuals require `localField` option | exception | error | virtuals, populate, schema-definition, missing-option |
| Model.findOneAndReplace() no longer accepts a callback | exception | error | mongoose, callback, promise, migration, api-change, replace |
| Path " " may not have `allowNull` specified when `required`… | exception | error | mongoose, schema, required, allownull, schema-options |
| `refPath` must be a string or a function that returns a… | exception | error | mongoose, refpath, populate, dynamic-refs, polymorphic |
| Cannot manually populate single nested subdoc underneath… | exception | error | mongoose, map, populate, single-nested |
| Collection#findAndModify unimplemented by driver | exception | error | mongoose, driver, legacy-api, find-and-modify |
| Connection has been closed and destroyed, and cannot be… | exception | error | mongoose, connection, destroy, lifecycle, restart |
| Invalid geoJSON type for $geoWithin | exception | error | mongoose, geojson, geospatial, query |
| Query.prototype.estimatedDocumentCount() no longer accepts… | exception | error | mongoose, callback, promise, migration, breaking-change, count |
| Cannot call `setClient()` with a MongoClient that you have… | exception | error | mongoose, setclient, mongodb-driver, connect, await |
| Cannot convert value to BigInt | exception | error | mongoose, bigint, cast, type-conversion |
| Can't call `openUri()` on an active connection with… | exception | error | mongoose, connect, multiple-connections, hmr, testing |
| Cast to [ ] failed for value " " (type ) at path " . | exception | error | cast-error, arrays, input-validation, save |
| QueryCursor.prototype.eachAsync() no longer accepts a… | exception | error | query-cursor, eachasync, callback, promise, mongoose-7, migration |
| Cast to UUID failed for value | validation | error | mongoose, uuid, cast, schema, casterror |
| Tried to set nested object field | exception | error | document, hydration, schema-mismatch, objectexpectederror, data-migration, mongoose |
| Model.exists() no longer accepts a callback | exception | error | mongoose, exists, callback, promises, migration |
| Path " " is not in schema, strict mode is `true`, and… | exception | error | mongoose, strict-mode, upsert, schema |
| Model.createCollection() no longer accepts a callback | exception | error | mongoose, callback-removed, promise, collection, migration |
| Reference virtuals require `foreignField` option | exception | error | virtuals, populate, schema-definition, missing-option |
| Parameter "obj" to Document() must be an object, got | exception | error | document, constructor, type-validation, objectparametererror, mongoose |
| batchSize must be at least 1 | exception | error | mongoose, cursor, eachasync, batch-size, bounds-check |
| Collection#createIndex unimplemented by driver | exception | error | mongoose, driver, index, testing |
| Invalid sort() argument. Must be a string, object, array… | exception | error | mongoose, query, sort, typeerror, invalid-argument |
| Model.init() no longer accepts a callback | exception | error | mongoose, callback-removed, promise, indexes, migration |
| Cast to Object failed for value | exception | error | mongoose, query, cast, logical-operators, null-safety |
| Got null array filter in | exception | error | mongoose, array-filters, update, validation |
| Invalid `path`. Must be either string or array. Got | exception | error | mongoose, internal-api, typeerror, path |
| `enum` can only be set on an array of strings or numbers … | exception | error | enum, arrays, validators, schema-definition |
| Path " " may not have `index` set to false and `sparse` set… | exception | error | mongoose, schema, index, sparse, options |
| Base SchemaType class does not implement a `cast()` function | exception | error | mongoose, schematype, custom-types, cast, subclassing |
| Cast to Embedded failed for value | validation | error | mongoose, subdocument, cast, query, casterror |
| Cast to boolean failed for value | exception | error | mongoose, boolean, cast, form-input |
| Mongoose only supports BigInts between -9223372036854775808… | exception | error | mongoose, bigint, int64, cast |
| Cast to Array failed for value | exception | error | cast-error, arrays, input-shape, save |
| Model.findByIdAndDelete() no longer accepts a callback | exception | error | mongoose, callback, promise, migration, api-change, delete |
| Cannot call next() on errored ChangeStream | exception | error | change-stream, next, error-recovery, mongoose |
| Query.prototype.countDocuments() no longer accepts a… | exception | error | mongoose, callback, promise, migration, breaking-change, count |
| sort() options argument must be an object or nullish | exception | error | mongoose, query, sort, options, invalid-argument |
| Model.syncIndexes() no longer accepts a callback | exception | error | mongoose, callback-removed, promise, indexes, migration |
| Must call `setClient()` with an instance of MongoClient | exception | error | mongoose, setclient, mongodb-driver, instanceof, type-check |
| First param to `schema.plugin()` must be a function, got | exception | error | plugins, imports, api-misuse |
| " " is not a valid UUID string | exception | error | mongoose, uuid, cast, format-validation |
| Invalid field "" passed to sort() | exception | error | mongoose, sort, query, user-input |
| Cannot convert a Buffer with subtype | exception | error | mongoose, buffer, uuid, bson |
| Mongoose does not support calling populate() on nested… | exception | error | mongoose, populate, subdocument, single-nested |
| Query must have `op` before executing | exception | error | mongoose, query, exec, api-misuse |
| Cannot create change stream with `hydrate: true` unless… | exception | error | change-stream, watch, hydrate, mongoose |
| Cast to Buffer failed for value | exception | error | cast-error, buffer, bson, driver-compat |
| Cast to string failed for value | exception | error | mongoose, string, cast, objects |
| The skipId parameter has been removed. Use | exception | error | document, constructor, skipid, mongoose-6, migration |
| `transform` function must be synchronous, but the transform… | exception | error | mongoose, tojson, transform, async, serialization |
| Attempting to remove virtual | exception | error | virtuals, cleanup, api-misuse |
| Model.prototype.deleteOne() no longer accepts a callback | exception | error | mongoose, delete, callback, promises, migration |
| Bad $within parameter | exception | error | mongoose, geospatial, legacy, query |
| Schema#pick() only accepts an array argument, got | exception | error | mongoose, schema, pick, invalid-argument |
| Union schema type requires an array of types | exception | error | mongoose, schema, union, types, validation |
| Can't use with Date. | exception | error | mongoose, date, query, operator, filter |