You need to define the field using an object:
type: {type: String}
More Related Contents:
- Push items into mongo array via mongoose
- E11000 duplicate key error index in mongodb mongoose
- Mongoose: findOneAndUpdate doesn’t return updated document
- Mongoose populate vs object nesting
- Stop Mongoose from creating _id property for sub-document array items
- Why does mongoose always add an s to the end of my collection name
- mongodb/mongoose findMany – find all documents with IDs listed in array
- MongoError: The ‘cursor’ option is required, except for aggregate with the explain argument
- add created_at and updated_at fields to mongoose schemas
- How to populate a sub-document in mongoose after creating it?
- Mongoose (mongodb) batch insert?
- (node:3341) DeprecationWarning: Mongoose: mpromise
- Mongoose deleting (pull) a document within an array, does not work with ObjectID
- Mongoose delete array element in document and save
- Mongoose populate nested array
- MongoDB – get documents with max attribute per group in a collection
- Automatically remove referencing objects on deletion in MongoDB
- How to fix ‘Error: querySrv EREFUSED’ when connecting to MongoDB Atlas?
- How to define object in array in Mongoose schema correctly with 2d geo index
- How can I generate an ObjectId with mongoose?
- How to get all count of mongoose model?
- Mongoose: CastError: Cast to ObjectId failed for value “[object Object]” at path “_id”
- Model.find() returns empty in mongoose [duplicate]
- Node.js – Mongoose – Check if a collection exists
- Mongoose – caused by :: 11000 E11000 duplicate key error index?
- Which SchemaType in Mongoose is Best for Timestamp?
- Mongoose: ObjectId Comparisons fail inconsistently
- Mongoose multiple connections
- set field as empty for mongo object using mongoose
- Create unique autoincrement field with mongoose [duplicate]