node.js - How to insert long value in mongo using node? -
i need insert long value attribute in mongo.
var sequences = this.db.collection('sequences'); sequences.insert( { _id: "test_seq", value: 1 }, done);
but inserting value integer, how make long?
use mongodb long
class. this.
const long = require('mongodb').long; var sequences = this.db.collection('sequences'); sequences.insert( { _id: "test_seq", value: long.fromint(1) }, done);
take here more details
mongo-db has default types gives values, that's why it's inserted integer.
Comments
Post a Comment