You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything is working fine. But I'm only able to get 10 Results at a time and I can't find a method to get all records in Resourcejs. I want to get all users at a time. Is this possible with Resourcejs or I've to migrate my code to another approach.
The text was updated successfully, but these errors were encountered:
There are a few things you can do. If you're are using Angulars $http to request the url, you can add a limit query parameter as follows, to the requested url: example.com/endpoint1?limit=999999
Additionally, you can add/change the limit in the Express request object before ResourceJs (or in a before handler to your resourcejs endpoint). For example, if you have some middleware thats being run before you hand the request to resourcejs, you can set the following property req.query.limit = 999999
Also to clarify, this is something we are planning on making easier in the future. Adding a limit to the querystring will always work but we are trying to figure out a better solution.
I want to get all records present in mongodb database. I've used
var Resource = require('resourcejs');
module.exports = function(app, route) {
// Setup the controller for REST;
Resource(app, '', route, app.models.usermodel).rest();
// Return middleware.
return function(req, res, next) {
next();
};
};
Above is the code on the server side and at client side in angularjs app I've used the below code
angular.module('clientApp')
.controller('UserCtrl', function ($scope, User, $route, logedin, $location) {
if(!logedin){
$location.url('/login');
}
$scope.route = $route;
$scope.users = User.getList().$object;
});
Everything is working fine. But I'm only able to get 10 Results at a time and I can't find a method to get all records in Resourcejs. I want to get all users at a time. Is this possible with Resourcejs or I've to migrate my code to another approach.
The text was updated successfully, but these errors were encountered: