Pretty new to mongo and mongoose.
I have
var mongoose = require('mongoose'), errorHandler = require('./errors'), ClientSummary = mongoose.model('ClientSummary'); exports.list = function(req, res) { ClientSummary.find().sort('-LastName').exec(function(err, clients) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { console.log(clients); res.jsonp(clients); } }); }; this returns double results for each client
I copied this from the console
[ { _id: '_?\u0007Z?WM???3\u0016?\u0017', ArchivedDate: Sun Dec 31 0 18:00:00 GMT-0600 (Central Standard Time), ArchiveDate: Sat Nov 08 2014 17:18:55 GMT-0600 (Central Standard Time), Archived: false, Phone: null, EmailAddress: '[email protected]', LastName: 'test', FirstName: 'test' }, { _id: '??\u0002otsF???\u000fF\u0010\u0019\n', ArchivedDate: Sun Dec 31 0 18:00:00 GMT-0600 (Central Standard Time), ArchiveDate: Sat Nov 08 2014 17:18:55 GMT-0600 (Central Standard Time), Archived: false, Phone: null, EmailAddress: '[email protected]', LastName: 'test', FirstName: 'test' } ] I get this from a query
db.clients.find() { "_id" : BinData(4,"U/UnaPQyRxqtc1iPJP7Lyw=="), "Contact" : { "FirstName" : "test", "LastName" : "test", "EmailAddress" : "[email protected]", "Phone" : null, "PhoneSecondary" : null }, "Address" : null, "Source" : null, "SourceNotes" : "asdf", "Archived" : false, "ArchivedDate" : ISODate("0001-01-01T00:00:00Z"), "StartDate" : ISODate("0001-01-01T00:00:00Z") } any thoughts would be greatly appreciated
Thanks,
Raif