How to use the orm.lt function in orm

To help you get started, we’ve selected a few orm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phikal / 4jhan-server / lib / db.js View on Github external
clear: function() {
                    var query;
                    if (config.limit)
                        query = Post.find().order('-modif').offset(config.limit);
                    else
                        query = Post.find({
                            'upload': orm.lt(new Date(new Date() - (6000 * config.timeout)))
                        });

                    query.run(function(err, posts) {
                        var del = function(dir, file) {
                            fs.exists(dir + '/' + file, function(e) {
                                if (e) fs.unlink(dir + '/' + file, erresp);
                            });
                        };
                        var processcom = function(err, com) {
                            for (var i in com.thread) {
                                del((config.upload || './img'), com.thread[i].img);
                                del('./thumb', com.thread[i].img);
                            }
                        };
                        for (var i in posts) {
                            if (err) return;

orm

NodeJS Object-relational mapping

MIT
Latest version published 1 year ago

Package Health Score

57 / 100
Full package analysis