diff --git a/src/ParseQuery.js b/src/ParseQuery.js index 9cd6a0c1f..0391b2a3c 100644 --- a/src/ParseQuery.js +++ b/src/ParseQuery.js @@ -1774,6 +1774,17 @@ class ParseQuery { return query; } + /** + * Change the source of this query to the server. + * + * @return {Parse.Query} Returns the query, so you can chain this call. + */ + fromNetwork(): ParseQuery { + this._queriesLocalDatastore = false; + this._localDatastorePinName = null; + return this; + } + /** * Changes the source of this query to all pinned objects. * diff --git a/src/__tests__/ParseQuery-test.js b/src/__tests__/ParseQuery-test.js index 22750890b..5038ce307 100644 --- a/src/__tests__/ParseQuery-test.js +++ b/src/__tests__/ParseQuery-test.js @@ -2346,6 +2346,10 @@ describe('ParseQuery LocalDatastore', () => { q.fromPin(); expect(q._queriesLocalDatastore).toBe(true); expect(q._localDatastorePinName).toBe(DEFAULT_PIN); + const query = q.fromNetwork(); + expect(q._queriesLocalDatastore).toBe(false); + expect(q._localDatastorePinName).toBe(null); + expect(query).toEqual(q); }); it('can query from pin with name', () => {