node.js - findarray in mongodb and output to array in nodejs -
I have an array inside the mosaics in the collection according to the below. ("53dbb05fa976627439d43884"), "employee": [{"Date": "1986-03-10"}, {"Date": "1986-12 -11 "}]}
Now I have all the specific dates and outputs for the array in NodeJay format.
var collection = db.collection ('employee'); Collection distance ('employee .Date') ToArray (function (mistake, docia) {console.log (docsa);}); }; The problem is that I will get the following error, but those collections can be run on the diestink command on the mangodeb. Can I avoid error in anyway?
TypeError: Undefined The method 'toArray' can not be called or is there any way I can get the same output Can I use collection.find ()?
you try collection.distinct ('employee.data') , But a collection called 'employee' I believe you want: collections. ('Date')
Comments
Post a Comment