0.8.0 • Published 6 months ago

mongoose-long v0.8.0

Weekly downloads
32,663
License
MIT
Repository
github
Last release
6 months ago

#mongoose-long

Provides Number Long support for Mongoose.

Build Status

Example:

const mongoose = require('mongoose')
require('mongoose-long')(mongoose);
const {Types: {Long}} = mongoose;

const partSchema = new Schema({
  long: {
    type: Long,
  }
});

const Part = db.model('Part', partSchema);
const part = new Part({long: '9223372036854775806'});

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

TypeScript Usage

Make sure you enable both compilerOptions.allowSyntheticDefaultImports and compilerOptions.esModuleInterop in your tsconfig.json.

import mongoose from 'mongoose';
import mongooseLong from 'mongoose-long';

mongooseLong(mongoose);

const Long = mongoose.Schema.Types.Long;
0.8.0

6 months ago

0.7.1

8 months ago

0.7.0

11 months ago

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.2

12 years ago

0.0.1

12 years ago