Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
mongodb-extended-json
Advanced tools
var EJSON = require('mongodb-extended-json');
var BSON = require('bson');
var doc = {
_id: BSON.ObjectID(),
last_seen_at: new Date(),
display_name: undefined
};
console.log('Doc', doc);
// > Doc { _id: 53c2ab5e4291b17b666d742a, last_seen_at: Sun Jul 13 2014 11:53:02 GMT-0400 (EDT), display_name: undefined }
console.log('JSON', JSON.stringify(doc));
// > JSON {"_id":"53c2ab5e4291b17b666d742a","last_seen_at":"2014-07-13T15:53:02.008Z"}
console.log('EJSON', EJSON.stringify(doc));
// > EJSON {"_id":{"$oid":"53c2ab5e4291b17b666d742a"},"last_seen_at":{"$date":1405266782008},"display_name":{"$undefined":true}}
// And likewise, EJSON.parse works just as you would expect.
EJSON.parse('{"_id":{"$oid":"53c2ab5e4291b17b666d742a"},"last_seen_at":{"$date":1405266782008},"display_name":{"$undefined":true}}');
// { _id: 53c2ab5e4291b17b666d742a,
// last_seen_at: Sun Jul 13 2014 11:53:02 GMT-0400 (EDT),
// display_name: undefined }
var request = require('request');
var url = 'https://cdn.rawgit.com/imlucas/mongodb-extended-json/master/test/data.json';
var EJSON = require('./');
var util = require('util');
var es = require('event-stream');
request.get(url)
.pipe(EJSON.createParseStream('*'))
.pipe(es.through(function(doc){
this.emit('data',
util.format('_id `%s` has timestamp %s\n', doc._id, doc._id.getTimestamp()));
}))
.pipe(process.stdout);
// Prints out:
//
// _id `54a1e4c798c1120000bb8b0f` has timestamp Mon Dec 29 2014 18:33:27 GMT-0500 (EST)
// _id `54a1e42f94042000008ac2f3` has timestamp Mon Dec 29 2014 18:30:55 GMT-0500 (EST)
// _id `54a1e3e68f038b0000631fe2` has timestamp Mon Dec 29 2014 18:29:42 GMT-0500 (EST)
// _id `54a1e3bc124968000052af15` has timestamp Mon Dec 29 2014 18:29:00 GMT-0500 (EST)
// _id `54a1e3a8124968000052af14` has timestamp Mon Dec 29 2014 18:28:40 GMT-0500 (EST)
// _id `54a1e2117b93d000002ee9bb` has timestamp Mon Dec 29 2014 18:21:53 GMT-0500 (EST)
// _id `54a1e1d6360382000019c110` has timestamp Mon Dec 29 2014 18:20:54 GMT-0500 (EST)
// _id `54a1e12ea5a5bb0000561dda` has timestamp Mon Dec 29 2014 18:18:06 GMT-0500 (EST)
// _id `54a1e0c14f3dc50000ba1afc` has timestamp Mon Dec 29 2014 18:16:17 GMT-0500 (EST)
// _id `54a1df90edbfd100001943b3` has timestamp Mon Dec 29 2014 18:11:12 GMT-0500 (EST)
FAQs
MongoDB Extended JSON.
The npm package mongodb-extended-json receives a total of 9,906 weekly downloads. As such, mongodb-extended-json popularity was classified as popular.
We found that mongodb-extended-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 29 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.