👩💻 Join our community of thousands of amazing developers!
How to convert bson file to json with javascript with a simple script file. Followup this simple proces Save the following file into index.js const fs = require('fs') const BSON = require('bson') function BSON2JSON (from) { const buffer = fs.readFileSync(from) let index = 0 const documents = [] while (buffer.length > index) { index = BSON.deserializeStream(buffer, index, 1, documents, documents.length) } return documents } const bsonFilePath = 'file.bson' const bson2json = BSO...