darrachequesne / spring-data-jpa-datatables

Spring Data JPA extension to work with the great jQuery plugin DataTables (https://datatables.net/)
Apache License 2.0
447 stars 173 forks source link

Making spring-data-datatables work with MongoDB #25

Closed prateekmathur1991 closed 8 years ago

prateekmathur1991 commented 8 years ago

I have a web page that is configured with DataTables client side configuration, and needs to be converted to DataTables server side configuration. The DB we are using is MongoDB.

Any ideas as to how can I make this library work with MongoDB?

darrachequesne commented 8 years ago

Hi! MongoDB is currently not supported. The mappings (DataTablesInput and all) are the same, but the querying part has to be implemented through the Mongodb Criteria API:

Query query = new Query(Criteria.where("firstName").is("Harry"));

It should maybe have its own module, something like spring-data-mongodb-datatables.

darrachequesne commented 8 years ago

Edit: there is already an implementation there https://github.com/biggates/spring-data-mongodb-datatables (but it does not seem to be deployed on Maven central sadly)

paulo-maia commented 7 years ago

Thank you for the beautiful module @darrachequesne Any idea on how to configure the mongo repository to use with this module? I'm always getting new exceptions, can't get it to work... Do I need a specific Config class? I'm a beginner in web applications development (and Springboot in particular) and in my examples I simply configure mongo using the application.properties file (which works out of the box). If at all possible, if someone provided a working example with MongoDB I would be eternally grateful...

darrachequesne commented 7 years ago

@paulo-maia I am not the author of the spring-data-mongodb-datatables module (never used it, in fact), did you check the example over there?

paulo-maia commented 7 years ago

I did, couldn't get it to work thought... I know that this module is not yours, just thought someone in this thread could post an example, the other one seems to be a bit abandoned.

paulo-maia commented 7 years ago

Got it working, no global search though!