mongoose-long

Long number type for Mongoose

#mongoose-long

Provides Number Long support for Mongoose.

Example:

var mongoose = require('mongoose')
require('mongoose-long')(mongoose);
 
var SchemaTypes = mongoose.Schema.Types;
var partSchema = new Schema({ long: SchemaTypes.Long });
 
var Part = db.model('Part', partSchema);
var part = new Part({ long: "9223372036854775806" });
 
var Long = mongoose.Types.Long;
part.long = part.long.divide(Long.fromString("2"));
part.save()
npm install mongoose-long

See node-mongodb-native docs on all the Long methods available.

LICENSE