Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/ParseQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
4 changes: 4 additions & 0 deletions src/__tests__/ParseQuery-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down