node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

mongoose-long

mongoose-long

===============

Provides Number Long support for Mongoose.

Build Status

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()

install

npm install mongoose-long

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

LICENSE