Futzing with read preference (#3963)

* 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
This commit is contained in:
Antonio Davi Macedo Coelho de Castro
2019-05-14 12:58:02 -07:00
committed by GitHub
parent 893f1d376e
commit afa74d655d
6 changed files with 915 additions and 333 deletions

View File

@@ -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);