mongoose-datatable
mongoose-datatable copied to clipboard
Not working with __ttl document expiration via mongoose-ttl plugin
I have been using mongoose-datatable for a long time without any problems (great plugin, thanks!).
However, today I added a __ttl (document expiration) by using the mongoose-ttl plugin. I use this by first defining my schema as normal, and then invoking the plugin: schema.plugin(ttl, { ttl: '90d' });
The problem that started happening is that even though I get data back via dataTables, it says:
recordsTotal: 0, recordsFiltered: 0,
Is there a known issue when working with other plugins or the mongoose-ttl one in particular?
And here's a pastie of my debug output:
http://pastebin.com/eq3avEdh
Hi,
The plugin __ttl is adding test to request like count, aggregate... :
model.count({ __ttl: { '$gt': new Date("Wed, 22 Feb 2017 21:32:57 GMT") } }) {}
mongoose-datatable module can be affected by plugins that modify request to the db such as __ttl.
To be tested with version 2.0.0: npm install --save git+ssh://[email protected]/eherve/mongoose-datatable.git