File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,26 @@ module.exports = function(AV) {
196196 return json ;
197197 } ,
198198
199+ /**
200+ * Returns true when there are more documents can be retrieved by this
201+ * query instance, you can call find function to get more results.
202+ * @see AV.SearchQuery#find
203+ * @return {Boolean }
204+ */
205+ hasMore : function ( ) {
206+ return ! this . _hitEnd ;
207+ } ,
208+
209+ /**
210+ * Reset current query instance state(such as sid, hits etc) except params
211+ * for a new searching. After resetting, hasMore() will return true.
212+ */
213+ reset : function ( ) {
214+ this . _hitEnd = false ;
215+ this . _sid = null ;
216+ this . _hits = 0 ;
217+ } ,
218+
199219 /**
200220 * Retrieves a list of AVObjects that satisfy this query.
201221 * Either options.success or options.error is called when the find
@@ -216,6 +236,9 @@ module.exports = function(AV) {
216236 if ( response . sid ) {
217237 self . _oldSid = self . _sid ;
218238 self . _sid = response . sid ;
239+ } else {
240+ self . _sid = null ;
241+ self . _hitEnd = true ;
219242 }
220243 self . _hits = response . hits || 0 ;
221244
You can’t perform that action at this time.
0 commit comments