-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.30
-
Component/s: MongoDB 3.2
-
Empty show more show less
I have a collection and data like this
{ "_id" : ObjectId("59425fbad3ade752a0d37e58"), "succeeded" : 1029940, "failed" : 89290, "cancelled" : 60067, "partial" : 18, "inconclusive" : 21124, "total" : 1200439, "captureStart" : 1496534400000, "captureEnd" : 1497139200000, "captureStartISO" : ISODate("2017-06-04T00:00:00Z"), "captureEndISO" : ISODate("2017-06-11T00:00:00Z") }
And my code is below, I need to show only partial field when I added "partial : 1" that show all fields but I can project others fields normally.
var MongoClient = require('mongodb').MongoClient; var url = "mongodb://10.52.200.154:27017/statistics"; MongoClient.connect(url, function(err, db) { if (err) throw err; db.collection("execution_statistic_week").find({},{'_id' : 0 , 'partial' : 1}).limit(1).toArray(function(err, result) { if (err) throw err; console.log(result); db.close(); }); });