So basically:
var mongoose = require('mongoose');
....
var opts = { noId: true, noVirtualId: true, strict: false }
DataHourlySchema = new Schema({}, opts);
var DataHourly = mongoose.model('DataHourly', DataHourlySchema);
I've taken a look at the lately added M/R-Support (
https://github.com/LearnBoost/mongoose/pull/922) where it is more or less done like this. Although the model is directly returned, it gets defined in the same way (but some additional sugar like the lean-option). So i should be able to count using:
DataHourly.count(function (err, docs) {
console.log(docs);
});
Or not? Unfortunately i get a zero returned. I also tried to access the collection directly (as i do with M/R currently as well until Mongoose comes with M/R-Support), but had no luck there as well:
Dataloaderlogfilesynchourly.collection.count(function (err, docs) {
console.log(docs);
});
I also tried adding virtual paths, but i do not really succeed in getting them work. I think i have to get the data directly from the driver, but i after reading for a while i still don't know how to do that...:
DataHourlySchema.virtual('uid').get(function () {
return this.get('_id.uid');
});
Where did i skip a step?
Thanks in advance!