Comments (10)
All ok, I found way
from mongoose-datatable.
Hi,
What exactly are you trying to do ?
this plugin is building the query over the info passed from DataTable.
from mongoose-datatable.
I have project on mean.io, in circles package used construction with mongoose queries for ACL rules
Look this
https://github.com/linnovate/mean/blob/master/packages/core/articles/server/controllers/articles.js
var query = req.acl.query('Article');
query.find({}).sort('-created').populate('user', 'name username').exec(function(err, articles) {
if (err) {
return res.status(500).json({
error: 'Cannot list the articles'
});
}
res.json(articles)
});
I want repeat this code but for datatable model, i want filtered result my table rows by ACL rules
thx for help
from mongoose-datatable.
This module takes the request generated from DataTable (from the front) to build the request.
You need to setup the DataTable with the fields you want to retrieve and build a web-service that takes the request and give it to the mongoose-datatable module. (see the test folder, there is an example)
This module actually build the mongoose queries over the datatable request, you can find the doc of the request there: https://datatables.net/manual/server-side
from mongoose-datatable.
Thanks, I used this object in options
... {conditions: {user: req.user._id}} ...
that filter my data as I want
In my schema I have array with references, but searching/sorting in this column not work, how i can use searching in array with populated data?
from mongoose-datatable.
Hi,
Sorry for the very late reply...
The module doesn't do any filtering or sorting on populate data.
The populate data are fetched after the root document is fetched so it is not possible with the actual implementation.
I hope you found a way arround to your needs.
Regards
from mongoose-datatable.
Cool, thanks for the feedback
from mongoose-datatable.
@iu3564 can you share the solution if you found for filtering or sorting on populate data.
from mongoose-datatable.
@eherve how i will filtering or sorting on populate data. can you add this in module or not?
from mongoose-datatable.
@saad3074 Hi,
This version of the module cannot search or filter on populated data.
The populated data are fetch after the search / sort request on the main document.
I'm rewriting the module to see if the populated data can be fetch using the aggregate $lookup.
But I do not know when it will be done.
from mongoose-datatable.
Related Issues (20)
- Nested object search HOT 1
- mongoose-datatable-demo does not work with v1.0.4 HOT 2
- Column filtering/searching with regex HOT 8
- Nested object array search (Question) HOT 2
- Default Boolean handler not works for false value HOT 1
- How to set conditions? HOT 1
- performance? HOT 1
- Unmanaged condition on field type: ObjectId HOT 3
- Can't get array data HOT 1
- Not working with __ttl document expiration via mongoose-ttl plugin HOT 2
- Date filtering HOT 5
- No data returned on mongoose 5 with options.conditions HOT 1
- search not working with populate data. HOT 1
- how to sort or order by date ('desc') HOT 1
- MongoDB uses non-optimal query indexes because of sort HOT 6
- Use aggregate with datatable HOT 1
- npm Installs Version 1.0.7 HOT 1
- Query lookup another collection, if not found still return HOT 1
- how to do subquery in formatter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose-datatable.