Giter VIP home page Giter VIP logo

mongo-datatable's People

Contributors

alwint3r avatar bentinata avatar ratson avatar togishub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mongo-datatable's Issues

Case caseInsensitive Search?

I tried adding caseInsensitive to both my jquery

$("#data-table").DataTable({
            "pageLength": 100,
            "aoColumnDefs": [
                { "mData": "archived", "name": "archived",  "aTargets": 0},
                { "mData": "offerId", "name": "offerId" ,   "aTargets": 1 },
                { "mData": "cpaNetwork", "name": "cpaNetwork",   "aTargets": 2  },
                { "mData": "voluumOfferName", "name": "voluumOfferName",   "aTargets": 3  },
                { "mData": "carrier", "name": "carrier",   "targets": 4  },
                { "mData": "countryCode", "name": "countryCode",   "aTargets": 5  },
                { "mData": "cpaOfferId", "name": "cpaOfferId",   "aTargets": 6  },
                { "mData": "dateCreated", "name": "dateCreated",   "aTargets": 7  },
                { "mData": "dateUpdated", "name": "dateUpdated",   "aTargets": 8  },
                { "mData": "shortName", "name": "shortName",   "aTargets": 9  },
                { "mData": "offerUrl", "name": "offerUrl",   "aTargets": 10  },
                { "mData": "country", "name": "country",   "aTargets": 11  },
                { "mData": "shortCyrptoName", "name": "shortCyrptoName",   "aTargets": 12  },
                { "mData": "fullCryptoName", "name": "fullCryptoName",   "aTargets": 13  },
                { "mData": "payout", "name": "payout",   "aTargets": 14  },
                ],
            "order": [[8, "desc"]],
            "processing": true,
            "search": {
                "caseInsensitive": true
            },
            serverSide: true,
            ajax: {
                url: '/offers/offerDbSearch',
                type: 'GET'
            },
        });

and also my node script

var options = req.query;
    options.search.caseInsensitive = true

Without caseInsensitive working, my search results are always a bit skewed. Any ideas?

mongoclient >= 3.0

with this version 3.0 of mongoclient (mine), i have to init options with :
options.search = {value : ""};
for not having assert error !

even with this line, using the sample code, i have the foowing result :

{
  "draw": 0,
  "recordsTotal": 0,
  "recordsFiltered": 0,
  "data": [],
  "error": "Columns must be defined!"
}

very strange !

Not getting expected results.

I'm trying to understand how this tool works. I keep getting responses of:

{
    draw: 0,
    recordsTotal: 0,
    recordsFiltered: 0,
    data: [ ],
    error: null
}

No errors, but no results either. I can see that the database has at least ten entries, and I can manually generate them using

 db.collection('clients').find({}).toArray(function(err, result) {
     if (err) {
         console.log(err);
     } else if (result.length) {
         res.send("<html><body>" + JSON.stringify(result, null, 4) + "</body></html>");
     } else {
         console.log('No document(s) found with defined "find" criteria!');
     }
     db.close();

Its not at all clear to me on how to do the setup so the DB returns the correct (all!) data fields, while utilizing the mongo-datatable tool correctly... Any hints on how to proceed? (I'd be happy to provide a minimal example, including populating the MongoDB so its clear to all, but I can't figure this out...)

So I added some error testing after new MongoDataTable(db).get('clients', options, function(err, result) { and I'm seeing AssertionError: failures. Not sure what's causing that.

Can someone tell me what they are using for options with a successful run? (preferably to return ALL data from a flat data collection. [i.e. no object hierarchy, no nested objects / arrays ] ..)

Unusable

node_modules\mongo-datatable\lib\columns.js:7
var globalSearchValue = options.search.value;
^
TypeError: Cannot read property 'value' of undefined
at Object.buildSearchCriteria (C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongo-datatable\lib\columns.js:7:42)
at MongoDataTable.get (C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongo-datatable\lib\MongoDataTable.js:24:29)
at C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\index.js:47:28
at C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongodb\lib\utils.js:510:9
at C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongodb\lib\mongo_client.js:130:17
at connectCallback (C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongodb\lib\operations\connect.js:29:9)
at C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongodb\lib\operations\connect.js:80:9
at C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongodb\lib\sdam\topology.js:219:25
at C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongodb\lib\cmap\connection_pool.js:273:25
at handleOperationResult (C:\Users\Adam\Documents\github\socketIOtable-nodejs\socket-iotable-nodejs\node_modules\mongodb\lib\sdam\server.js:363:9)

Get this after trying to run for the first time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.