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

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -