如何在node.js中将bson转换为json?
如何在node.js中将bson转换为json? 我正在检查两个不同obj之间的差异,这显示了一个错误,因为它需要JSON。(来自Mongodb的数据fatch) 我正在使用下面的链接快速json补丁,但它不起作用 下面的作业1数据:我想比较作业1和作业2如何在node.js中将bson转换为json?,json,node.js,bson,Json,Node.js,Bson,如何在node.js中将bson转换为json? 我正在检查两个不同obj之间的差异,这显示了一个错误,因为它需要JSON。(来自Mongodb的数据fatch) 我正在使用下面的链接快速json补丁,但它不起作用 下面的作业1数据:我想比较作业1和作业2 [ { name: 'Tape', cost: 10, datetime: 2016-12-29T14:28:06.846Z, update_by: '', _id: 5
[ { name: 'Tape',
cost: 10,
datetime: 2016-12-29T14:28:06.846Z,
update_by: '',
_id: 58651d762cd7d2f00cc2de26,
image_path: null },
{ name: 'Wire',
cost: 100,
datetime: 2016-12-29T14:28:06.845Z,
update_by: '',
_id: 58651d762cd7d2f00cc2de24,
image_path: null } ]
工作2
[ { image_path: null,
_id: '58651d762cd7d2f00cc2de26',
update_by: '',
datetime: '2016-12-29T14:28:06.846Z',
cost: 10,
name: 'Tape',
id: '58651d762cd7d2f00cc2de26' },
{ image_path: null,
_id: '58651d762cd7d2f00cc2de24',
update_by: '',
datetime: '2016-12-29T14:28:06.845Z',
cost: 100,
name: 'Wire',
id: '58651d762cd7d2f00cc2de24' } ]
job
和job2
在bson中?是的,亲爱的…一个是请求..另一个是来自mongodb的fatch数据
[ { image_path: null,
_id: '58651d762cd7d2f00cc2de26',
update_by: '',
datetime: '2016-12-29T14:28:06.846Z',
cost: 10,
name: 'Tape',
id: '58651d762cd7d2f00cc2de26' },
{ image_path: null,
_id: '58651d762cd7d2f00cc2de24',
update_by: '',
datetime: '2016-12-29T14:28:06.845Z',
cost: 100,
name: 'Wire',
id: '58651d762cd7d2f00cc2de24' } ]