S
S
Standalong2018-06-14 18:14:57
Mongoose
Standalong, 2018-06-14 18:14:57

What is wrong in mongoose schema when setting mixed data type MIxed?

Here is a workable mongoose schema:

var schema = mongoose.Schema({
        title: String,
        name: String
});

It is required to change the data type to mixed (Mixed) for name.
I change according to the Mongoose documentation :
var schema = mongoose.Schema({
         title: String,
         name: Schema.Types.Mixed
});

After that, the nodejs console gives an error:
name: Schema.Types.Mixed,
^
ReferenceError: Schema is not defined
Where is the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2018-06-14
@RidgeA

Schema variable is not defined....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question