Saturday, 15 May 2010

angularjs - Restangular query on large collection returns functions -


I have a selection that requires a list of ~ 15000 option loads. On the first receiving, options are resolved on the $$ state entrance 25, using the following function:

  prmList: function (distinguished, $ q, $ state) {var deferred = $ Q.defer (); Var pList = []; $ State.primaryList = []; $ State.poff = 0; Restellular.all ('primary'). GetList ({limit: 25, offset: $ state.pOff}) / / GET: / primary Then (function (p) {$ state.primaryList = p; deferred.resolve ($ state priority list);}) Deferred return }  

The application is using Joey so that the route can be treated like this:

  Primary search: {method: 'GET' Path: '/ preferences, handler: controller. Primary search}  

The handler is shown here:

  Primary search: function (request, answer) {pSearch (request). Hold (function (error) {request.server.log (['error', 'database'], error); Answer (boom.badata ('unable to find agreements.'));}); }  

and the functions that are shown here are:

  function pSearch (request) {return Primary.find (_ compactObject (request.query. )) Except (request.query.offset) .limit (request.query.limit) .execAsync (); }  

I am outputting the returned value in the console and so far it is a very large list of specific tasks. I should also mention that the model for the primary named collection is primary in which I want to get all the data.

I am still being used for Happi / Joy / Transpolular / Mongo so any help would be appreciated. Thanks!

Then after a long time I finally found out that it was a foolish mistake by the name's name. Collection in Mongodb was designed to search the 'primitive' collection, while I named them 'primary'. I did not really think that it was plural properly, just thought it's a 'on' tag in silly. Eligible


No comments:

Post a Comment