I guess it's a stupid question but i would like do something like this
var mongoose = require('mongoose');
var Long = require("long");
var UserSchema = new mongoose.Schema({
id: Long(),
name: String,
completed: Long(),
note: String,
updated_at: { type: Date, default: Date.now },
});
But it's not working,"cannot set 'low' property". I know that cause I do not pass arguments in the "Long" constructor but it's not working iven if I don't put the "()". I'm a bit lost with that ^^'
Sorry for my english ^^'
You should use a module specifically designed for Mongoose, like mongoose-long:
var mongoose = require('mongoose')
require('mongoose-long')(mongoose);
var Long = mongoose.Schema.Types.Long;
var UserSchema = new mongoose.Schema({
id : Long,
name : String,
completed : Long,
note : String,
updated_at : { type: Date, default: Date.now },
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With