I have a schema-less Model i.e. a blank schema as :
const NewSchema = new mongoose.Schema({
});
The reason I need this is, I am expecting unstructured and unexpected fields as of now during the development phase of my project.
var myModel = new Mongoose.model('myModel', NewSchema)
When it receives a float value like 0.1, it is stored as a "Double" in mongoDB. The issue is when it receives something like 1.0 or 0.0 which is saving by default as 1 and 0.
myModel.create({
"videoLength" : 0.0
})
Result in database.
{
"videoLength" : 0 (Int32)
}
Expectation is, for it to be saved as 1.0 and 0.0 as type Double. I know this is possible by specifying types in Schema but how to do this without specifying the fields with types explicitly in schema.