Skip to content

Commit

Permalink
Futzing with read preference (parse-community#3963)
Browse files Browse the repository at this point in the history
* allow setting readpreference when using rest api.

* take out partially complete unit test.

* oops. nit

* Include read preference option for find directly from api and adding few more tests

* Adding catch for all tests

* Keep same check for get and find

* Turn read preference case insensitive

* Includes and subqueries read preferences through API

* Fixing bugs regarding changes that were done in master branch during the last year

* Changing behavior to make includeReadPreference and subqueryReadPreference to follow readPreference by default
  • Loading branch information
davimacedo authored May 14, 2019
1 parent 08ee05d commit f3c6c06
Show file tree
Hide file tree
Showing 6 changed files with 939 additions and 357 deletions.
16 changes: 6 additions & 10 deletions spec/GridFSBucketStorageAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ describe('GridFSBucket and GridStore interop', () => {
expect(gfsResult.toString('utf8')).toBe(twoMegabytesFile);
});

it(
'properly deletes a file from GridFS',
async () => {
const gfsAdapter = new GridFSBucketAdapter(databaseURI);
await gfsAdapter.createFile('myFileName', 'a simple file');
await gfsAdapter.deleteFile('myFileName');
await expectMissingFile(gfsAdapter, 'myFileName');
},
1000000
);
it('properly deletes a file from GridFS', async () => {
const gfsAdapter = new GridFSBucketAdapter(databaseURI);
await gfsAdapter.createFile('myFileName', 'a simple file');
await gfsAdapter.deleteFile('myFileName');
await expectMissingFile(gfsAdapter, 'myFileName');
}, 1000000);

it('properly overrides files', async () => {
const gfsAdapter = new GridFSBucketAdapter(databaseURI);
Expand Down
Loading

0 comments on commit f3c6c06

Please sign in to comment.